Fix tooltips sometimes continuously displaying when the button is selected (#14832)

Release Notes:

- Fixed sometime tooltip will continuously display when the button is
selected.

---

@mrnugget The #13857 This change has led into a bug, the selected item
before tooltip will continuous display if there are no other tooltips.



https://github.com/user-attachments/assets/06b4a9a4-dede-4c18-b020-e20b6090341f
This commit is contained in:
Jason Lee 2024-07-20 02:49:08 +08:00 committed by GitHub
parent 1dc4d4200f
commit 0a02691778
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1869,6 +1869,11 @@ impl Interactivity {
});
}
// Ensure to remove active tooltip if tooltip builder is none
if self.tooltip_builder.is_none() {
element_state.active_tooltip.take();
}
if let Some(tooltip_builder) = self.tooltip_builder.take() {
let tooltip_is_hoverable = tooltip_builder.hoverable;
let active_tooltip = element_state