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

Allow to drag the parent of the selected element #267

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

cibernox
Copy link
Collaborator

@cibernox cibernox commented Oct 4, 2024

Motivation

Quite often, elements have wrappers with no padding. When there's no padding, it's not possible to select the wrapper of an element because the click always lands on the children.
Until now, it was possible to click the "Go one level up" button to traverse the tree towards the root, but it was incovenient.

Now, when an element is selected to be dragged, the parent element also shows a handle button to drag it. This makes dragging much more convenient, as there's less steps involved in selecting and dragging the element you intended.

How does it look

parent-dragging-h265.mov

Refactor the drag menu option to not have singleton data so we can have as many instances of as we want.
Instead, the element it will drag is passed in from the outside.
@cibernox cibernox self-assigned this Oct 4, 2024
@cibernox cibernox merged commit 30875ba into main Oct 4, 2024
@cibernox cibernox deleted the allow-to-drag-parent branch October 4, 2024 15:43
leandrocp pushed a commit that referenced this pull request Oct 9, 2024
* Allow to drag the parent of the selected element

Refactor the drag menu option to not have singleton data so we can have as many instances of as we want.
Instead, the element it will drag is passed in from the outside.

* Remove log, position handle better

* Highlight the parent of the selected item

* Dragging the parent works!

* auto format code

---------

Co-authored-by: cibernox <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants