Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Strange offset when dragging between trees #133

Unanswered
pmkrawczyk asked this question in Q&A
Discussion options

Hi All,

First, kudos to the authors for this amazing component! :-)

I'm trying to implement two trees, sitting in two independent ControlledTreeEnvironment's. The issue I face is that when dragging item, e.g. 'g1' from the right tree into the folder 'A' in the left tree (see image below), the left tree detects the drag-over event with rather big Y offset.

image

This offset is not always the same - a small change (a few px) in Y of the dragged object when moving over the root element will cause the drag-over highlight to jump to the next tree item.

Here is an animated gif that illustrates the issue (the dragged object is not visible unfortunately but the cursor is outlined in red)
chrome-capture-2022年7月12日

It looks like some CSS positioning issue but I can't figure out what it could be...
I wasn't sure whether this is a bug or something related to our particular DOM structure, so I thought I'll ask here first :-)

Any help will be greatly appreciated!

You must be logged in to vote

Replies: 2 comments 2 replies

Comment options

Is the user intended to be able to drag items from one tree to the other? Then both trees should be mounted within the same tree environment, that's the idea behind the environment. Not sure if this is related to the positioning issue though 😅

You must be logged in to vote
2 replies
Comment options

Yes, that's the goal. And no, the trees are not in the same environment. In the docs i found that this is not required...

Comment options

Well, they need to for your use case and that's also written in the page you linked:

The requirement for multiple trees sharing drag-and-drop capabilities and state is that they are placed within the same tree environment, i.e. either a shared ControlledTreeEnvironment or an UncontrolledTreeEnvironment.

Comment options

This is embarrassing, don't know how i missed this...
Anyway, thank you for the answers (and for RCT :-)!

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /