Component: IconButton tooltip persists when button becomes disabled #3067
Labels
[Feature] UI Components
Impacts or related to the UI component system
[Type] Bug
An existing feature does not function as intended
Issue Overview
Mouse events that the Tooltip relies upon for determining when to show and hide a tooltip are not fired for disabled nodes. As a result of the implementation in #2405, it was decided that it is fine for tooltips not to be shown for these disabled elements. However, where this becomes an issue is when a button becomes disabled while a tooltip is already visible, where the tooltip is then permanently stuck on screen because the
mouseleave
event will not be fired to dismiss the tooltip.Steps to Reproduce (for bugs)
Expected Behavior
Tooltip should be dismissed.
Current Behavior
Tooltip is stuck.
Possible Solution
The tooltip assumes a single child, in this case the button element. We could check for changes to the
disabled
prop, but it's not guaranteed that DOM attribute is exclusively dependent on a prop by this name.A more extreme approach might be to attach a MutationObserver to find when the
disabled
DOM attribute is applied to the tooltip child.The text was updated successfully, but these errors were encountered: