-
Notifications
You must be signed in to change notification settings - Fork 267
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
Dropdown closes when opening parent ( in long list) #198
Comments
This seems like the same issue as #148. I'm not sure why the workaround is not working in the latest version. Will have to dig deeper. |
Wow thank you for your quick response let me know if i can help |
Well, we need to find a permanent fix for this. I'm thinking about alternative ways of detecting outside click or finding the root cause of firefox's behavior. Maybe it's a browser bug? Anything you can think of in finding the root cause or coming up with alternate solutions will be a great help. |
What is your opinion on using react-click-outside? I have a PR ready in case you want to go this way? |
From what i see the lines added in #178
are not in the updated develop. |
Thanks for looking into it! I'm generally averse to increasing bundle size by adding another dependency, especially since react-outside-click employs the same The I'm curious to see why Firefox behaves differently than the spec. We can always add the fallback or employ another technique if we are running short on time. |
I was able to reproduce this in Edge too - so it seems Chrome is probably the quirky one. I'm going to dig a bit deeper on this. |
I've seen that answer before and I was under the impression that React will normalize all that with it's click handler. |
## What does it do? Prevents event bubbling on node expand-click. The function isOutsideClick only gets a short part of two items (li.node + i.expand), then the parents stop, in Firefox. This causes it to be detected as an outside click. In chrome the path is instead empty and no outside click is therefore detected. Fixes #198 Can test here (switching between v1.17/developTemp): Expand the first two nodes: ![bild](https://user-images.githubusercontent.com/17863113/55436725-5bce8b80-559d-11e9-927d-17149643100c.png) Scroll to bottom and expand: ![bild](https://user-images.githubusercontent.com/17863113/55436759-6c7f0180-559d-11e9-8bd9-7ad141b5c9ca.png) https://ellinge.github.io/react-dropdown-tree-select-test/#v117-nocheckeddefault https://ellinge.github.io/react-dropdown-tree-select-test/#DevelopTemp-nocheckeddefault There still seems to be some issue with scroll in firefox after initial scroll and expand which does not happen in chrome. The expanded item gets out of view. This also happens on scoll and check. ## Type of change - [x] Bug fix
## What does it do? Prevents event bubbling on node expand-click. The function isOutsideClick only gets a short part of two items (li.node + i.expand), then the parents stop, in Firefox. This causes it to be detected as an outside click. In chrome the path is instead empty and no outside click is therefore detected. Fixes #198 Can test here (switching between v1.17/developTemp): Expand the first two nodes: ![bild](https://user-images.githubusercontent.com/17863113/55436725-5bce8b80-559d-11e9-927d-17149643100c.png) Scroll to bottom and expand: ![bild](https://user-images.githubusercontent.com/17863113/55436759-6c7f0180-559d-11e9-8bd9-7ad141b5c9ca.png) https://ellinge.github.io/react-dropdown-tree-select-test/#v117-nocheckeddefault https://ellinge.github.io/react-dropdown-tree-select-test/#DevelopTemp-nocheckeddefault There still seems to be some issue with scroll in firefox after initial scroll and expand which does not happen in chrome. The expanded item gets out of view. This also happens on scoll and check. ## Type of change - [x] Bug fix
🎉 This issue has been resolved in version 1.18.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug
In Firefox when the list is long. After scrolling down until more nodes are loaded (> 100) clicking on a parent node will close the dropdown.
To Reproduce
Use this demo.
Expected behavior
The dropdown should stay open after expanding a parent node in all browsers.
Environment (please complete the following information):
Additional context
The parent node has to be after 100 nodes.
The text was updated successfully, but these errors were encountered: