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

Popover with triggers="focus" not working on MacOs #1795

Closed
gilsdav opened this issue Mar 22, 2017 · 15 comments · Fixed by GulajavaMinistudio/ngx-bootstrap#18
Closed

Popover with triggers="focus" not working on MacOs #1795

gilsdav opened this issue Mar 22, 2017 · 15 comments · Fixed by GulajavaMinistudio/ngx-bootstrap#18

Comments

@gilsdav
Copy link
Contributor

gilsdav commented Mar 22, 2017

On our projects and on your demo site, the popover with focus trigger doesn't work on Safari and Firefox (MacOsx). But it works on Chrome (MacOsx).

The original popover bootstrap works but not ng2-bootstrap popover.
https://www.quirksmode.org/dom/events/blurfocus.html

Firefox Mac and Safari and Chrome do not fire the events on radios and checkboxes if the user uses a mouse.

Within my test: On FF Mac, we can see the popover using tab key but not by clicking. On Safari, keyboard doesn't work.

A js fix to be able to handle focus event on button: http://jsfiddle.net/kzfg0pdh/6/

Temporary fix

On component that directly use popover:
Use this on HTML
triggers="focus:blur"
On ts
ngAfterViewInit() { const sels: any = document.querySelectorAll('[triggers]'); for (let i = 0; i < sels.length; i++) { sels[i].addEventListener('click', function() { sels[i].focus(); }); } }

@valorkin
Copy link
Member

interesting

@Kanishkaz
Copy link

Having the same issue. Firefox on windows doesn't like the focus trigger.

@jboothe
Copy link

jboothe commented Apr 22, 2017

Same issue here on Mac Chrome, Firefox & Safari.

@savyasachi-sa
Copy link

Facing the same issue. triggers=focus not working on Firefox Mac

@liymike
Copy link

liymike commented May 4, 2017

Having the same issue on mac with chrome firefox and safari, but works perfectly on windows using Microsoft Edge.
And also works on linux(opensuse) using firefox.

@scndel
Copy link

scndel commented May 5, 2017

The same issue for me with Firefox OSX & Safari on our project. Do you have any idea about potential fix or should we give up your solution ?

gilsdav added a commit to gilsdav/ngx-bootstrap that referenced this issue Jun 3, 2017
gilsdav added a commit to gilsdav/ngx-bootstrap that referenced this issue Jun 3, 2017
@valorkin
Copy link
Member

ok, it seems to be as designed (by browsers)
just add tabindex="1" to your element
and it works

@gilsdav
Copy link
Contributor Author

gilsdav commented Jul 6, 2017

@valorkin
Your solution

tabindex="1"

doesn't work for us. We already have the problem on Safari and Firefox.

Please reopen the issue (or accept my pull request).
Thanks ;)

@scndel
Copy link

scndel commented Jul 6, 2017

Hi, Gilsdav is damn right, that workaround is useless. You should merge his fix...

@parasharabh
Copy link

Use instead of and add tabindex="0". This solved the issue for me.

@ckrandhir
Copy link

tabindex="0" did not solve the problem

@valorkin
Copy link
Member

valorkin commented Mar 4, 2019

Have you tried v3.3.0?

@ckrandhir
Copy link

no. is this problem is solved in v3.3.0 ?

@valorkin
Copy link
Member

valorkin commented Mar 5, 2019

positioning service was completely reworked

@ckrandhir
Copy link

Its better than the previous but still not hiding if I clicking outside the poopover but it is hiding if I am clicking other button for other poopover

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants