[2.5.3] Icon on button not changing

Hey all,

Recently moved my dashboard from 2.3.2 to 2.5.3 and noticed some oddities after the transition with themes and layout, but most recently that my buttons aren’t getting their icon’s changed on click any longer.

I took UD-ActiveDirectory from the marketplace many months ago and added on to it heavily, but this wasn’t a problem on 2.3.2 so I’m curious if something changed or I’m missing something in the button configuration. The button in question is the one used to disable/enable an ADObject. OnClick no longer update, but the command is still being sent.

Tested this out in a very basic dashboard by stripping everything out and it still does not seem to update. Could anyone confirm this behavior or point me in the direction of a potential fix?

Welcome @jorf just to confirm have you built your own theme, or are you using one of the pre-defined theme. Are you able to post a small code snippet to show what did work in 2.3.2 but now not working in 2.5.3.
I did remember seeing a github issue open for the buttons, but cannot remember full details. I am sure if you post some code someone can confirm if bug, or if you have to change it slightly. Thanks

I have not built my own theme- I was using the Azure theme, but that lead to some issues were the font color in drop down lists was too dark to see. Currently I am using the Earth theme.

Here is the relevant portion of the code:

New-UDButton -Id 'btnEnabled' -Icon $btnIcon -Text $EnabledText  -OnClick {
      if ($Object.Enabled)
      {
        Set-UDElement -Id 'btnEnabled' -Content {
          New-UDIcon -Icon 'check'
          'Enable'
        }
      }
      else
      {
        Set-UDElement -Id 'btnEnabled' -Content {
          New-UDIcon -Icon 'xing'
          'Disable'
        }
      }
    }

Hi @jorf
The buttons was remade in 2.5-ish i believe.

See:

Hotfix is WIP

Interesting, thanks for providing that. I’ll try to work around it for the time being, people here haven’t yet noticed the button not changing.

Hello again @jorf the reply that @BoSen29 kindly posted was the github issue I was thinking about…A while back a user on this forum @wsl2001 did this really cool custom component:-

Which I am hoping @adam will include in the next dashboard or something similar. I mean on one of my dashboards I use a pre-loader with some text I mean you could use this approach, or you could use a toast notification…thanks for providing the code, I will have a look at this and see if I can do something to change icon, but as @BoSen29 mentioned this is a WIP…I mean universal dashboards has changed so much since I been using it, and @adam only makes it better and better…you could also try downloading the latest release (releases link) from the official github page to see if the problem still exists in the latest build…