? ? Success

User tests: Successful: Unsuccessful:

avatar C-Lodder
C-Lodder
18 Aug 2016

Pull Request for Issue #10821

Summary of Changes

Changed the default delay times for the show and hide events for Bootstrap Tooltip to prevent fast hovering making them disappear.

Please note this is not a perfect PR, but it's the only approach I can think of. There's hardly any information about this issue so the only thing I can think of is it maybe being some sort of conflict with the likes of Mootools.

Testing Instructions

Bit hard to explain but those who have had the same issue will know. Go into the Joomla admin panel and continuously and rapidly move the cursor over an element that displays a tooltip. After hovering over the element about 5-10 times, move your mouse over it again and the tooltip won't display.

After applying the patch, do the same thing. It shouldn't cause the same issue due to the delay times.

/cc @ggppdk @creative3d

avatar joomla-cms-bot joomla-cms-bot - change - 18 Aug 2016
Category JavaScript
avatar C-Lodder C-Lodder - open - 18 Aug 2016
avatar C-Lodder C-Lodder - change - 18 Aug 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Aug 2016
Labels Added: ?
avatar C-Lodder C-Lodder - change - 18 Aug 2016
The description was changed
avatar C-Lodder C-Lodder - edited - 18 Aug 2016
avatar C-Lodder C-Lodder - change - 18 Aug 2016
The description was changed
avatar C-Lodder C-Lodder - edited - 18 Aug 2016
avatar C-Lodder C-Lodder - change - 18 Aug 2016
The description was changed
avatar C-Lodder C-Lodder - edited - 18 Aug 2016
avatar dgt41
dgt41 - comment - 18 Aug 2016

@C-Lodder you are changing external library file here, you could do:

$opt['delay']     = isset($params['delay']) ? (is_array($params['delay']) ? $params['delay'] : (int) $params['delay']) : { show: 100, hide: 400 };

in libraries/cms/html/bootstrap.php

avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

@dgt41 - Is that change needed though? Cause if the delay variable is not defined calling the tooltip in PHP, it will resort to the bootstrap.min.js default parameters

avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

Oh do you mean instead of changing the bootstrap.min.js?

avatar dgt41
dgt41 - comment - 18 Aug 2016

yup

avatar joomla-cms-bot joomla-cms-bot - change - 18 Aug 2016
Category JavaScript Libraries
avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

@dgt41 - ok done but it's not parsing the Json object parameters correctly. Here is the var_dump of the $options:

Result: '{"html": true, "delay": "{show: 100, hide: 400}", "container": "body"}'

Expected: '{"html": true, "delay": {"show": 100, "hide": 400}, "container": "body"}'

avatar dgt41
dgt41 - comment - 18 Aug 2016

@C-Lodder crap, try: array('show' => 100, 'hide' => 400) instead of {show: 100, hide: 400}

avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

@dgt41 - lol yup just figured it out :)

avatar creative3d
creative3d - comment - 18 Aug 2016

@C-Lodder I've just changed 453 string in libraries/cms/html/bootstrap.php on array('show' => 100, 'hide' => 400);
But the issue still exists. Am I too early? Or have I done something wrong?

avatar zero-24
zero-24 - comment - 18 Aug 2016

@C-Lodder Travis fails now see: https://travis-ci.org/joomla/joomla-cms/jobs/153328882

1) JHtmlBootstrapTest::testTooltip
Verify that the tooltip script is initialised
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'jQuery(function($){ $(".hasTooltip").tooltip({"html": true,"delay": {"show": 100,"hide": 400},"container": "body"}); });'
+'jQuery(function($){ $(".hasTooltip").tooltip({"html": true,"container": "body"}); });'
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/cms/html/JHtmlBootstrapTest.php:388
avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

@zero-24 - I can't see why Travis would fail.
@creative3d - Hmm odd, do you at least notice the delay the the tooltips when they disappear?

avatar zero-24
zero-24 - comment - 18 Aug 2016

it looks like that the new code produce a different JS output.

-'jQuery(function($){ $(".hasTooltip").tooltip({"html": true,"delay": {"show": 100,"hide": 400},"container": "body"}); });'
+'jQuery(function($){ $(".hasTooltip").tooltip({"html": true,"container": "body"}); });'
avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

Yes, that's because there should be. We're now setting a default delay value ;)
Do I need to update the Unit tests?

avatar zero-24
zero-24 - comment - 18 Aug 2016

If it is an indent change yes.

avatar joomla-cms-bot joomla-cms-bot - change - 18 Aug 2016
Category Libraries Libraries Unit Tests
avatar joomla-cms-bot joomla-cms-bot - change - 18 Aug 2016
Labels Added: ?
avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

@zero-24 I've updated the Unit tests, but knowing my luck, these will need to be merged before the tooltip update

avatar zero-24
zero-24 - comment - 18 Aug 2016

@c-lodder it works now. Travis just complaining a cs issue now with a to long line ;)

avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

@zero-24 - Updated :)

Travis - stop bloody moaning!

avatar creative3d
creative3d - comment - 19 Aug 2016

@C-Lodder I think I noticed the delay, but the issue is still noticed too, with 447 line and 454 line :(
I'm moving mouse around an element in a circle fast, then from the left to right, right to left, and when I stop in the center, the tooltip appear one time and instantly disappear (usually)
Was it fixed in Bootstrap 3? How was it fixed there? Can it be applied here?
P.S. Don't know if you know, you may also install NoNumber tooltips to use with articles, I attached you a table with elements, each element uses a NN tooltip. It works the same as in admin panel. Maybe it'll help to test...
katakana.txt

avatar C-Lodder
C-Lodder - comment - 19 Aug 2016

Yup, I believe this was fixed in Bootstrap 3.3.0.

I'll look at the patch and try implementing it.

avatar creative3d
creative3d - comment - 19 Aug 2016

I've just googled "bootstrap 3 tooltip example". The first example with Bootstrap 3.3.7 worked fine! (I did, however, manage to brake it :) but it restored itself on the next hover)

avatar C-Lodder
C-Lodder - comment - 24 Aug 2016

I've now applied the patch from BS3.

Still not perfect but it's all I can do really.

cc/ @creative3d @zero-24

avatar creative3d
creative3d - comment - 24 Aug 2016

Well, it still breaks, but with delay and that fix, it's more difficult to break it...
I'll try to see if users notice the difference after I implement these changes.
Here is an example which works perfect without any delays: BS 3 example
P.S. When Joomla is going to use BS 3? Is it a difficult change for Joomla? Will we need to change templates with this change?

avatar C-Lodder
C-Lodder - comment - 24 Aug 2016

It will be a massive change that will take months of development and testing. It won't happen for J3.x but will for 4.x

avatar dgt41
dgt41 - comment - 24 Aug 2016

@C-Lodder since the code from v3 didn't solve the problem I would suggest to close this, with a remark won't fix as it is totally related to bs2.3.2 which is outdated and in few months joomla 4 will not use that any more. Maybe a better approach is to try and find a way to move from 2.3.2 to 3, part of it is #11654

Don't spent your precious time on bugs that will be cured by flipping the bs version. My 2cents

avatar dgt41
dgt41 - comment - 24 Aug 2016

@creative3d there are few ppl working on that. Eg with #11654 I demonstrate a way to decouple the bootstrap js from the php (the html coupling can't be undone, but it can be overridden)

avatar C-Lodder
C-Lodder - comment - 24 Aug 2016

@dgt41 - Yup, you're right. I'm not going to start stripping down the Tooltips when, like you said, J4.x is going to start happening in the not too distant future.

I'll leave this up to the powers to decide whether the delay (which helps but does not fully fix the issue) should be merged.

cc/ @brianteeman @rdeutz @wilsonge @zero-24

avatar creative3d
creative3d - comment - 24 Aug 2016

@dgt41, "in few months joomla 4" - it that really "few months"? It's just this bug's been for 2 years, few months are nothing in comparison, but I haven't seen any information about J4.

avatar brianteeman
brianteeman - comment - 24 Aug 2016

and you are the only person ever to report this

On 24 August 2016 at 15:22, creative3d notifications@github.com wrote:

@dgt41 https://github.com/dgt41, "in few months joomla 4" - it that
really "few months"? It's just this bug's been for 2 years, few months are
nothing in comparison, but I haven't seen any information about J4.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11661 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8YLmOd1VSgZSHn6cC2nl_hKieFXhks5qjFO9gaJpZM4Jnpjk
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar creative3d
creative3d - comment - 24 Aug 2016

It's because some administrators delete or close topics which they don't understand.

avatar dgt41
dgt41 - comment - 24 Aug 2016

@creative3d can you show me one of your issues that was closed without a good reason, as I can't find it?

avatar C-Lodder
C-Lodder - comment - 24 Aug 2016

@creative3d - This is a Bootstrap 2 issue, NOT a Joomla issue, therefore it is not up to us to fix it. We're simply powering the CMS with a 3rd party framework.

I've tried to come up with a fix for you and others who may have had the same issue. It does not fix it but makes it better than before. The fact being is that J4.x is in the planning and it will be a major release. Major releases are the only time B/C breaks like updating Bootstrap can be made. It's going to take time, but it WILL happen

avatar creative3d
creative3d - comment - 24 Aug 2016

@dgt41 No, I can't, it was two years ago, can't find it! The second time it was in other's topic, not mine... It doesn't matter, I'm not here for arguing, it's just Brian keeps reminding me... instead of...

avatar creative3d
creative3d - comment - 24 Aug 2016

@C-Lodder, I understand. Thanks for fixing it. I think we need to ask those who experienced the bug before if it should be merged. And I ask users, it will take time.

avatar mbabker
mbabker - comment - 24 Aug 2016

I think we need to ask those who experienced the bug before if it should be merged

Except it doesn't work that way at all. If this patch isn't fixing the issue (or I guess improving the conditions it takes to experience it if I'm following things right), then it shouldn't be merged. That's why we require human testing on all patches and shouldn't be merging things based on popularity.

avatar brianteeman
brianteeman - comment - 24 Aug 2016

We dont merge based on popularity or how loud someone shouts

On 24 August 2016 at 16:17, Michael Babker notifications@github.com wrote:

I think we need to ask those who experienced the bug before if it should
be merged

Except it doesn't work that way at all. If this patch isn't fixing the
issue (or I guess improving the conditions it takes to experience it if I'm
following things right), then it shouldn't be merged. That's why we require
human testing on all patches and shouldn't be merging things based on
popularity.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11661 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8ZwODIf1lx7ASoc1pxJLkS8kqtQ8ks5qjGBygaJpZM4Jnpjk
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar creative3d
creative3d - comment - 24 Aug 2016

@mbabker Test it correctly, of course, I'm just saying from user experience. If it's improving things, why ignore it, right?

avatar creative3d
creative3d - comment - 24 Aug 2016

Right now I'm playing with a tooltip and can't break it. So, consider it as a full fix, not an improvement.

avatar ggppdk
ggppdk - comment - 24 Aug 2016

I see the bug several times per day,

especially since recently i was making changes to the language strings and i had to review the tooltips ...

you can try to force it to appear by going over an element that has a tooltip,

  • and at near its border, quickly move it in and out for the element borders, for a couple of seconds or more untill you cause the bug to appear (stop mouse inside (over) the element),

also you can see it rarely if the mouse is over the element while page is loading , it is a "race-condition" issue show and hide fired handlers run simultanuesly, whichever finishes last wins ... and if wrong one wins you go into a bad state ...

This PR has 2 changes,

  • the 1st change that adds delay 100ms to show and 400ms to hide is annoying, but it does make the bug a lot more difficult to appear (makes it 5x or 10x more rare), still since it introduces an annoying delay this is tradeoff, and not a fix ...

  • the 2nd change is something that is nice and it is not a trade-off, before the patch, if you trigger the bug you need to find a DIFFERENT element with a tooltip, hover it and then GO BACK to the other element that the tooltips is not showing,

with this 2nd change you do not need to find such an element, you can move out and back over the element and the tooltip will appear,
https://github.com/joomla/joomla-cms/pull/11661/files#diff-38878f657eb0a1c6fe9d820f59dc9bf4R1187

avatar dgt41
dgt41 - comment - 24 Aug 2016

I will just post my opinion here a bit more clear:

Let it be.

Why?

  • BS 2.3.2 is unsupported
  • We are patching BS files
  • Tooltips on hover is a HELL NO from UX/UI perspective since the introduction of touch devices
  • BS4 is coming in few months with J4
  • The bug might be annoying but it won't really make the system unusable for nobody.
avatar mbabker
mbabker - comment - 24 Aug 2016

We are patching BS files

Sadly that argument holds zero weight since the project hacked the BS files years ago.

avatar creative3d
creative3d - comment - 24 Aug 2016

Tooltips on hover is a HELL NO from UX/UI perspective since the introduction of touch devices

a hover on PC, and a "touch" on touch devices, I've checked on a mobile, also works better for me.

avatar dgt41
dgt41 - comment - 24 Aug 2016

@creative3d I am curious: how exactly do you recognise which labels/elements have a tooltip, or you randomly touch the screen till something comes up?

avatar dgt41
dgt41 - comment - 24 Aug 2016

@creative3d and also how do you manage to reveal tooltips on clickable elements (a, btn, etc):
screen shot 2016-08-24 at 21 14 37

a hover on PC, and a "touch" on touch devices, I've checked on a mobile, also works better for me.

NO IT'S NOT WORKING OK

avatar creative3d
creative3d - comment - 25 Aug 2016

@dgt41 by using NN tooltips, read above

avatar creative3d
creative3d - comment - 25 Aug 2016

Listen, for me the issue is solved, I'm really greatful to @C-Lodder, a 2 year bug was fixed. No one wanted to listen to me, but he did. If you want to leave the bug for another 2 years, that's your call. I don't understand such a decision, but it's not my business, I'm just a user, not a developer. It was hard for me to get through all this bureaucracy here when messages are ignored and some moderators put themselves above other people...
Good bye!
From Russia with love :)

avatar C-Lodder
C-Lodder - comment - 4 Sep 2016

Closing as this simply isn't going anywhere

avatar C-Lodder C-Lodder - change - 4 Sep 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-09-04 14:14:19
Closed_By C-Lodder

Add a Comment

Login with GitHub to post a comment