-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Tooltips cannot be dismissed on iOS #16028
Comments
You're referring only to iOS and not Android, correct? We could give |
Yes. That would make it more intuitive for iOS users but the problem is you On Tuesday, 10 March 2015, Chris Rebert notifications@github.com wrote:
|
Uh, no, I mean that should literally theoretically (with some minor additional changes) fix the dismissibility problem. See linked article. |
Woops! True, that's convenient. Good find On Tuesday, 10 March 2015, Chris Rebert notifications@github.com wrote:
|
@cvrebert is this a css issue? |
@fat It's an iOS Safari quirk/bug: https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile |
@cvrebert i just meant more, that if we wanted to pursue a fix, woudl we just add that css snippet to the tooltip component… or did you expect the js to fix this somehow? (label wise) |
@fat I guess it would need to be in the JS. Something like: if ('ontouchstart' in document.documentElement) { // or whatever "is this a touch device?" test we want to use
$('body').css('cursor', 'pointer');
} |
there is no bullet-proof way for this part though...and it would likely cause quirky effects on hybrid devices like touch-enabled laptops, surface, etc |
I guess we'd ought to toss in some iOS Safari detection/UA-sniffing for good measure. |
@cvrebert Why not just use the // Safari Mobile
if(window.Touch) { /* JavaScript for your touch interface */ } |
@kkirsche I'm pretty sure that's not specific enough. There are browsers besides Safari that support Touch Events. |
Ah, ok. Thank you for the information. I wasn't aware of that 😃 |
If JavaScript will fix this bug, it would be cool to have auto-hiding tooltips (after 2sec for ex). |
auto-hiding would potentially cause issues for keyboard (and particularly assistive technology) users, depending on who it's implemented... |
@patrickhlauke : problems are related with keyboard be hiding when DOM changes? Maybe if we can preserve input focus and did not reset viewport - all will be ok? |
I'd need to see an example implementation to give a definitive yes/no, but in principle: what happens if a user moves focus to something which then triggers a tooltip. Will they have enough time to read it before it disappears. And with assistive technologies, will AT still announce the content if it disappears suddenly. Even for sighted mouse users, will they have enough time to see the tooltip before it disappears again. etc |
I see this is still a problem in v4 as well in iOS. I don't know if it's worth mentioning, but whatever they're doing in this jquery plugin over here - it works in iOS. It ain't smooth (unless that's just the crappy iPhone 4S I was testing on), but at least it works: |
solution http://jsfiddle.net/stereotipo/suhq88b0/17/ test on iOS (ipad and iphone), android and windows |
Hi @stereotipo! You appear to have posted a live example (http://fiddle.jshell.net/stereotipo/suhq88b0/17/show/light/), which is always a good first step. However, according to the HTML5 validator, your example has some validation 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.) |
solution http://jsfiddle.net/stereotipo/suhq88b0/18/ |
Hi @stereotipo! You appear to have posted a live example (http://fiddle.jshell.net/stereotipo/suhq88b0/18/show/light/), 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.) |
oh yeah… i think the best solution imho for ios is using an invisible screen… surprised i didn't already do that in v4 |
I recently had this issue and resolved it by using touch events and ignoring mouse events that come immediately after said touch events. I used Bootstrap's Here is a gist with the solution. Let me know if this is something that could be adapted as an official solution, if there are any major flaws with it, and/or if there's really a much better way of doing things already brewing. I'd like to be able to help with resolving this issue and would definitely like to improve what I have as well. |
@alekseyg I confirm your solution is working today at version alpha 5. Just used it in order to fix this issue and got it working. |
@alekseyg - just chiming in to second that confirmation of success with the solution - thank you! |
this worked for me...
|
@fat do you still plan on adding the invisible screen in v4? I just checked it doesn't seem to been added. Are you in a "let's wait and seewhat IOS does before I put time implementing this" stance ? Thank you |
Actually probably the reason why the invisible screen was never implemented is probably because this doesn't make sens if you have a clickable element in the page, you will need to click twice to focus into an input...I guess it's going to be a waiting game on IOS at this point =/ |
counter-intuitive, but would |
@alekseyg Is there a way to update your code so it doesn't close on scroll? |
@jlavoie13 I've run into several tiny issues with this approach and have been working on improving it. I'll update the gist soon with some improvements. |
see the contortions one has to go through for iOS here #22426 i'd really like to avoid having an invisible backdrop, as that just causes new problems (on touch-enabled devices with additional inputs, like touchscreen laptops/tablets with paired mouse). i really wish iOS followed what Android and co do, which is to NOT have weird quirks relating to event bubbling/delegation... |
@jlavoie13 I've updated my gist. Here's a summary of what I changed:
|
not tested this yet, but as a note: adding a |
#22481 ports the same hack i used for dropdowns to tooltips. while hacky, it's relatively small and has no known side-effects - all it does is coax iOS into doing event delegation/bubbling like all other touch-enabled browsers (grumble grumble) |
@gregblass I checked out https://github.com/sandywalker/webui-popover and it worked for me as well right out of the box! Thanks! That saved me a lot of time in resolving this problem in my application. |
I ended up with this so far so good ... credit to: |
While @turigeza solution works so tooltips are dismissible, this is only for iOS Safari, and in cases where a button invokes a modal or similar, the tooltip remains until you tap elsewhere. I really think a solution that targets touch-enabled devices (not just iOS Safari) that auto-dismisses a tooltip after [x] seconds would be the best, and with Bootstrap 4 being mobile-first, I think should be part of the framework. |
so let's be clear...is there still a current issue even after fixes etc? if so, please file a fresh issue with a reduced test case |
I agree with Joyrex. I have just removed every single tooltip from a site because I noticed in iOS they stack and won't go away. |
@patrickhlauke - well, yes - there really never was an adequate “fix” to begin with, for the reasons I pointed out. |
and again, i'll ask you to post a reduced test case to show the issue, and post a fresh issue. the workaround implemented at the time covered the common scenario of tooltips like http://getbootstrap.com/docs/4.1/components/tooltips/#examples and they work fine on iOS. if there's further situations that currently fail...post a new issue instead of adding to a closed thread started in 2015 |
On iOS after click tooltip does not disappear BS 3. |
@turigeza: FYI, this no longer works :( |
If you have an issue please create a new one with a live test on a CodePen thanks |
Tooltips can be shown on mobile by clicking, but you cant get rid of them.
They swallow up click events too so you can't add click handlers to the body to hide them.
Same as the problem noted in #3417 #6232 - both full of exasperated users..
If this isn't going to be fixed, at least a note could be put in the docs saying don't use tooltips if you want it to work on mobile without custom code disabling them for mobile devices...
The text was updated successfully, but these errors were encountered: