-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox hangs on to tooltip after the item has been disabled and/or destroyed #15632
Comments
Hi @redbmk! You appear to have posted a live example (http://jsbin.com/pudojataxo/1/edit), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
Fixed the bootlint errors: http://jsbin.com/pudojataxo/2/ |
(1) and (2) confirmed in Mac Firefox and in Mac Safari 8.0.2. However, the arguable answer here is "Well, you should be destroying/hiding the tooltips yourself when you disable/remove their buttons like that". We've generally shied away from using Mutation Observers or the like, which is the only framework-agnostic approach I'm aware of to implement something like this.
To be pedantic, it's HTML that doesn't allow for it. Browsers don't fire hover events on disabled buttons. |
Ah, yeah I see (2) in Chrome as well. Hmm, it looks like using bootstrap's I actually ran into this issue when using knockout, which has "enable" and "disable" bindings that make things pretty convenient. I'll just have to remember to avoid using those for buttons with tooltips. Is browser support the main reason for shying away from Mutation Observers, or is it more of a performance issue? |
Semi-duplicate of #2298. |
A fellow Knockout user! Hi brother 👋
Actually, I can't find an outright rejection anywhere of the idea of using mutation observers now that I look for one. |
Bootstrap 4 support would be awesome. The jsbin I created previously had expired. I've cloned it after logging in so it should stick around longer now: http://jsbin.com/kupugi/2/ |
This is a little weird, but I also found out that in Chrome you can get (1) to recreate by opening the console, hovering to get the tooltip, then moving the mouse out of the frame screen really fast. When you move the mouse back into the frame the tooltip will go away unless you first disable the button in the console. Probably not something that would happen often, but the observers would likely solve that issue as well. Here's a quick fix to (1:FireFox) for knockout users wanting to keep using the enable/disable bindings: (function () {
var ogEnableUpdate = ko.bindingHandlers.enable.update,
ogDisableUpdate = ko.bindingHandlers.disable.update;
ko.bindingHandlers.enable.update = function (element, valueAccessor) {
ogEnableUpdate(element, valueAccessor);
if (element.disabled && $(element).data("bs.tooltip")) $(element).tooltip("hide");
};
ko.bindingHandlers.disable.update = function (element, valueAccessor) {
ogDisableUpdate(element, valueAccessor);
if (element.disabled && $(element).data("bs.tooltip")) $(element).tooltip("hide");
};
})(); |
Same problem here. Doesn't happen in Chrome, but it does happen in Firefox and IE. |
Punting anything involving |
By default bootstrap doesn't allow for tooltips being active on disabled buttons. However, there seems to be a bug in Firefox where if the tooltip is showing when the button becomes disabled it will continue to show until the button is re-enabled and the user hovers in and out of the button. In the same fashion, if the button is removed while the tooltip is showing then the tooltip will stick around again.
I've created a simple jsBin to showcase both scenarios:
The bug does not present itself in Chrome (v39), but does in Firefox (v35).
The text was updated successfully, but these errors were encountered: