Skip to content
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

Links in popovers are very hard to click #1667

Open
verheyenkoen opened this issue Jul 26, 2024 · 4 comments
Open

Links in popovers are very hard to click #1667

verheyenkoen opened this issue Jul 26, 2024 · 4 comments
Labels

Comments

@verheyenkoen
Copy link
Contributor

Enhancement

Hyperlinks in popovers (fancy tooltips) are very hard to click since the popover disappears if you unhover (mouseleave) the triggering element.

Steps to reproduce

  1. Go to any page that contains an more information icon for which the popover contains a hyperlink (eg: the authors card in publications)
  2. Hover the information icon in the card title next to "Authors"
  3. Try an click the "More information about authors and editors" link. You'll have to do this within 1 second of leaving the icon or the popover will have disappeared and the link is gone.

Screenshots

popover-bug

Additional context

This can be fixed with quite a bunch of scripting or we can switch the popover trigger to "click" - which means you'd also need to click it to hide the popover.

@verheyenkoen verheyenkoen added the enhancement New feature or request label Jul 26, 2024
@verheyenkoen verheyenkoen changed the title Links in popovers very hard to click Links in popovers are very hard to click Jul 26, 2024
@verheyenkoen
Copy link
Contributor Author

Found this possible solution. It's a bit hacky since it temporary replaces the popover.hide() method with a dummy, but that may be the simplest solution.

@nicolasfranck
Copy link
Contributor

Strange, we had this problem before with popovers, and then we decided to only open the popover when you click the icon (instead of on hover), as it gives the user more control. There may be also a lot of text to read in that box, so clicking a link is just one side problem.

So I am a bit confused about why this pops up again (pun intended). There are examples of these kind of open-on-click boxes. I guess, that these examples you showed are a mere remnant of that old way. Right? @mietcls

@verheyenkoen
Copy link
Contributor Author

@nicolasfranck It's being discussed in #339 but that resulted in a new epic #346 that doesn't really mention this anymore. Forgotten?

Also, this may have been a recent regression when we upgraded bootstrap from v4.6 (with popover.trigger default "click") to v5.2 (with popover.trigger default "hover focus"). They actually changed this between v5.1 and v5.2. Version 5.3 still has "hover focus" as the default.

Obviously, if it used to be "click" and nobody noticed the regression, we can simply override the default:

Popover.prototype.defaults.trigger = "click";

Please note that "click" means: click again on the triggering element, not just click anywhere outside the popover. This also doesn't respond to ESC keystrokes.

@mietcls mietcls self-assigned this Sep 10, 2024
@mietcls
Copy link
Member

mietcls commented Sep 10, 2024

I like the click idea. Hover is not an action anyways, as it doesn't work well on touch devices. Is that sufficient @verheyenkoen ?

@mietcls mietcls removed their assignment Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants