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

Bug: Dropdown menu item doesn't receive focus on click in iOS #3519

Closed
k-spen opened this issue Dec 17, 2019 · 5 comments
Closed

Bug: Dropdown menu item doesn't receive focus on click in iOS #3519

k-spen opened this issue Dec 17, 2019 · 5 comments

Comments

@k-spen
Copy link

k-spen commented Dec 17, 2019

Bug description:

The dropdown menu items don't receive focus on click in iOs, multiple versions.

Link to minimally-working code that reproduces the issue:

https://ng-bootstrap.github.io/#/components/dropdown/examples

iphone-focus-bug

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 7

ng-bootstrap: 4.0.2+ (still a bug on your code example)

Bootstrap:4.4.1+

Multiple browser on iPhone including Safari, Chrome, FireFox and DuckDuckGo

This can also be repro'd on your site today in desktop at the mobile breakpoint (Chrome):

image

@k-spen k-spen changed the title Dropdown menu item doesn't receive focus on click in iOS Bug: Dropdown menu item doesn't receive focus on click in iOS Dec 17, 2019
@haoolii
Copy link

haoolii commented Dec 20, 2019

I have the same question, I removed renderer.appendChild(dropdownElement, dropdownMenuElement); in dropdown.ts, it works, but I don't know what is this effect.

 private _resetContainer() {
    const renderer = this._renderer;
    const menuElement = this._menuElement;
    if (menuElement) {
      const dropdownElement = this._elementRef.nativeElement;
      const dropdownMenuElement = menuElement.nativeElement;

      // renderer.appendChild(dropdownElement, dropdownMenuElement);
      renderer.removeStyle(dropdownMenuElement, 'position');
      renderer.removeStyle(dropdownMenuElement, 'transform');
    }
    if (this._bodyContainer) {
      renderer.removeChild(this._document.body, this._bodyContainer);
      this._bodyContainer = null;
    }
  }

@maxokorokov
Copy link
Member

maxokorokov commented Jan 2, 2020

Indeed the (focus) on the dropdown menu item is not triggered neither on desktop nor on mobile Safari 13

@maxokorokov
Copy link
Member

Looks like the same issue with clicking on <button> as in #2780

@maxokorokov
Copy link
Member

maxokorokov commented Jan 3, 2020

Actually I don't see anything we should fix on ng-bootstrap side here.

Any comments are welcome

@maxokorokov
Copy link
Member

Closing, please reopen if necessary

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

No branches or pull requests

3 participants