Skip to content

Conversation

@sukram230799
Copy link

If I dynamically change a custom icon (themeIcon), the class would be appended instead of replaced. This is because we only set the class to true via classes[value] = true; but never delete the old classes that are no longer passed as arguments. To fix this, I just replace the classes object with a new one.

<Link
  ...
  iconMd={pinnedState ? "icon:mdi mdi-pin-off" : "icon:mdi mdi-pin"}
  ...
/>

Example before change of pinnedState

<i class="icon mdi mdi-pin" style=""> </i>

Example wrong

<i class="icon mdi mdi-pin mdi mdi-pin-off" style=""> </i>

Example correct

<i class="icon mdi mdi-pin-off" style=""> </i>

@nolimits4web
Copy link
Member

Thank you! The fix should be done in a bit different way, so i pushed the new fix for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants