Comments (7)
It's reported that this happens. I am also aware that there can only be one instance of html5 backend on the page at once.
I found out that in one of the latest updates the HTML5Backend dependance that they use here it is possible to pass a root element that will allow 'localization' of this behavior only to the chosen component.
Hopefully someone can fix it.
from react-arborist.
@Arthur-Ruthenberg thanks for the comment. Because I don't feel like I fully caught your message, let me ask: are you having this problem in your app with react-arborist? Or are you helping suggest a solution for how we might fix this?
from react-arborist.
@jameskerr
Both.
I was trying to implement a simple dragging of an element in my project (I also have implemented the react-arborist there) and I stumbled upon this problem. The native onDrag event is being blocked by react-dnd-HTML5Backend library.
This library puts an event listener on the window.onDragStart which blocks any subsequent onDrag events.
I dug a little further within the react-dnd-HTML5Backend and they said there that sometime during the 2021 they made an improvement to the library to allow passing of a 'root' object to the dnd provider and it is supposed to fix this bug.
from react-arborist.
Thank you for the research. Now I understand the issue. I do know of the "root" option you are referring to. If you are in a hurry, I'd welcome a contribution to react-arborist that adds a "dndRoot" option to the props and passes it to the react-dnd provider. Otherwise, I'll work on this as I have time. Thanks for your help!
from react-arborist.
This is an issue with reactDnd: react-dnd/react-dnd#3344 This is unfortunate.
I will add a prop to the Tree component called dndRootElement
so that you can scope the drag listeners to whatever element you want. If none is specified, it will default to window.
from react-arborist.
@Arthur-Ruthenberg in the latest release (version 1.1.0) you can pass a dndRootElement prop to the tree to scope the event listeners. Let me know if that works for you!
from react-arborist.
@jameskerr Thank you!
I will check it out ASAP!
I actually wanted to do it myself next weekend, but you beat me to it
from react-arborist.
Related Issues (20)
- Inifinite Scrolling within Branches? HOT 2
- Item count increases randomly HOT 1
- Property 'select' does not exist on type 'never' HOT 1
- Hidden flag for nodes HOT 1
- Doesn't work on remix HOT 1
- React Aborist ScrollTo bug with deep nested nodes HOT 1
- [HELP] Multiple selection from array of ids
- Render 1 million root elements on different screen sizes
- Deselect not firing event HOT 2
- How to drag a node INTO a leaf node
- Better scrolling while user is dragging
- [Question] How to build a tree with some folders open and some closed? HOT 1
- There is a bug in using the tree.update method to set height.
- Duplicate HTML5 backend error HOT 5
- Deletion behavior can be unintuitive HOT 4
- Lack of control over delete leads to some weird scenarios HOT 2
- Should we be able to focus the entire tree? HOT 2
- Using react-arborist in an app seems to break file & folder drop on <input type="file" multiple /> elements HOT 2
- How rename `name` to `node_name` and create node with name
- Drag and Drop should be handled within the level hierarchy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-arborist.