Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor the draggable component to avoid passing around unnecessary props #18756
Refactor the draggable component to avoid passing around unnecessary props #18756
Changes from all commits
7838531
798a830
2fc44aa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prop was available so alternative editor implementations could hide the drag icon if they needed (mobile?). Perhaps it's fine to remove, but wanted to flag in case it's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How successful was that? Any editor you know ever used it?
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's on!
Not a blocker and would definitely go with what you think is better given that I'm not very active lately. However, I still think
IconDragHandle
has a place here to hide how the DnD logic works and to maintain the same level of abstraction than the other icons. I find it more useful and fitting now that we've removed theonDragStart
/onDragEnd
boilerplate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's not all good or bad no matter what we do here.
Personally, while working on it, I find the indirection unnecessary as I was forced to jump between three components (DragHandle, BlockDraggable and the Mover).
What other icons you're talking about, I personally find it a bit more consistent this way as the Mover is rendering all its buttons in the same way (directly usiung
<IconButton>
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish that was the case! But I can't help but feeling that the "children as function" pattern is still odd and
IconDragHandle
is a nice way to hide it from readers (until they are ready or need to dig in).However, my concerns are lessened by the fact that, whatever drag component we use, it is not meant to be widely reusable, so I'm ok with this approach.