Pomax / react-onclickoutside

An onClickOutside wrapper for React components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Links outside the component does not work on iPad Landscape mode

Yunus0497 opened this issue · comments

I had used this library in my Navigation bar component, which has dropdowns, so that, any clicks outside the navbar component should prompt the dropdown to close. It was working fine in all the devices, except in the iPad, that too, only on iPad landscape mode.

None of the links(anchor tags) or buttons worked while the iPad orientations is landscape, however the buttons worked when tapped with two fingers.

commented

When you run a connected Safari for remote debugging, any errors in the dev console?

Not a single error or anything on the console or the Network tab. Although I'm tapping the buttons/links, it was just like nothing happened on the Developer tools.

commented

Is this on the most recent safari? (Safari's kind of become the new IE, it seems to intentionally do things in ways that break code written to work cross-browser)

I don't have an ipad, but some more test results might help surface enough information that someone knows what's wrong:

  • does this happen when loading in portrait and then tilting to portrait?
  • does this happen when loading already in landscape mode?
  • the code runs up the ancestor chain for elements that receive a click: if you add a console log to your code like document.addEventListener(click, evt => console.log({ element: evt.target })), does the parentNode go all the way up through body to html to null?
  1. Yes it is happening on the most recent Safari. I couldn't check in the previous versions.
  2. It is happening both times(while loading in portrait, then tilting to landscape, and also while loading already in landscape).
  3. I just included an onclick handler on some of the anchors and buttons to log something on the console. But it didn't.