-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Use Popovers instead of Tooltips if a title and description is present #8174
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
Conversation
layouts/joomla/form/renderlabel.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no clue what you talk about 😊
|
NIce and simple but works only for labels, not the other tooltips. Indeed an issue in frontend where not only does it show far away from the label (defeating the purpose of the tip and totally invisible on small screens, see picture) but also one can have multiple type of tips on the same page: Note: concerning #8150, it needs more care as it also concerns Hathor, Protostar and Beez. |
|
We had the same alignment issue with our tooltips, which was fixed with #5137. I have now included the same fix for popovers as well. And yes, it only affects forms as this is the place where I expected a title/content combination. This should be B/C as long as the template supports popovers, which a good template should support anyway. |
|
As for the failing unit tests, I don't understand those enough to fix them. I thought I had found it, but apparently not 😊 |
|
@Bakual |
Good find. That seems to be unrelated to this PR. I have found two places in core where we already use popovers and it doesn't work nice with RTL there as well:
We should fix it in all places and I would prefer that to be done in another PR if possible. |
|
@Bakual Note: as stated in the other PR, this needs CSS changes in every template. So I wonder about B/C. |
|
I think we could add the RTL CSS rule to this (tooltip) block: https://github.com/joomla/joomla-cms/blob/staging/media/jui/less/bootstrap-rtl.less#L582-L585 The data-placement will work for most cases I think. What I like about the default value is that I think it automatically changes the placement if there is no room to show it. Like if there is no room on the right, it will go down or so. But have to test that. |
|
As far as I know, only Isis is using bootstrap-rtl.less |
|
Protostar loads the compiled bootstrap-rtl.css file while Isis compiles its own template-rtl.css which includes the bootstrap-rtl.less file. |
|
Updated to take care of RTL languages. |
|
Popovers don't look nice for Hathor, but they are already used in the modul manager. So that would have to be fixed anyway. |
|
The problem with both of those templates is they aren't natively Bootstrap designed. In the case of Hathor specifically it has bits and pieces of Bootstrap hacked into it but the template was never fully Bootstrap capable. |
|
Yeah, I know that. And thus it fails on any Bootstrap feature we actually have APIs within the CMS to use. It's a bad example we do here. |
|
I have tested this item ✅ successfully on e0af65c This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
We could do a template override just for Isis and Protostar and be totally B/C. |
|
This PR has received new commits. CC: @DGT41 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
@infograf768 Works now also for Isis and Hathor. As a side effect, the "New Module" view in the Hathor module manager now has working popovers as well. I leave it to others to decide if we want to do that only for our core templates (using JLayout overrides) or change it in core. |
|
What about the Modules Select page? I did not make a PR because
|
|
That would be an exsting bug anyway since that view already uses popovers in Isis. The same happens there as well. I'm not sure if it needs to be fixed though. It's not like it's that important :) |
|
The issue is clearly the use of data-placement="top" or "bottom" which makes bootstrap popover arrow failing. |
|
Hmm, looks fine in Chrome and IE for me when trying both with placement top and bottom. Looks like a bug in your browser then? |
|
I have tested this item ✅ successfully on 009fc69 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
Hello @Bakual "This branch has conflicts that must be resolved" This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
Hello @Bakual, I have tried to apply patch but it doesn't successful. I think it is because Merge Conflicts like @gunjanpatel said. Thanks. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
This PR has received new commits. CC: @DGT41, @iljabos, @mikeveeckmans This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
@gunjanpatel @rahultailored Branch is rebased with current staging now and conflict in hathor/css/template.css is solved. Should be fine again. |
|
I have checked Article edit pages in mobile view and desktop view, and found only category field tool-tip and another fields tool-tips just want to know that, Is it an issue ? This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
The "Category" field tooltip doesn't has a title, just the "category" text (quite useless actually). Thus it shows as a regular tooltip (white font on black ground). The other fields below (Version Note, Author's Alias, Status, Featured, ...) all also should have a "popover"-style tooltip. |
|
I have tested this item 🔴 unsuccessfully on bfda664 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
@kalpesh681 Can you be more specific about your enviroment? Because when I try to reproduce the issue with Chrome (faking a Galaxy S5) it seems to work fine. I also don't see a reason why it shouldn't work for specifc fields. The code is always the same. |
|
@Bakual I checked in Firefox 47.0 and screen size 320 X480 (faking an IPhone 4) size. |
|
I checked in latest staging CMS testing successfully, now not able to see issue, Thank you for update me. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
@kalpeshtailored Can you log a successful test then? |
|
I have tested this item ✅ successfully on bfda664 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
I found z-index issue with popover while editing article. Check the "Tags" option in image below. I also notice that border cuts down in smaller screens but I think real device may not have same issue because I am testing using Chrome(Version 48.0.2564.103 (64-bit)) mobile testing tool. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
I don't think the z-index issue is something that has to be fixed. Select options most likely should stay on top anyway. |
|
I have tested this item ✅ successfully on bfda664 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8174. |
|
@Bakual I was testing this issue and have a question. Can the search field of the Search Tools have a popover as well? |
|
@roland-d Sure, We just would have to change this line: https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/searchtools/default/bar.php#L39 to call popover instead of tooltip. |
|
@Bakual Do you want to do that in this PR or should we get a separate one for that? |
|
I'd rather do it in an own. This one is for the places where there is a title and description present. The searchfield only has one of it so it would be something else. |
|
@Bakual Fair enough, merged this one :) |










Inspired by #8150
This PR uses the Bootstrap "popover" method to display a tooltip when there is a title and description present in a form.
To test, you can have a look at an article edit form. The "Title" field doesn't have a description, thus a regular tooltip is shown. The alias does have both, thus the popover will be used.
In backend this worked fine for me. In frontend, the placement was looking bad because it goes that far right. Not sure why it behaves different there.
I tried with position it on top, but then it got cut in backend for the alias, so that isn't ideal either. And I think it actually looks better when placed right there.