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
Sortable component #4199
Sortable component #4199
Changes from 2 commits
3bd1d4c
30fd201
0a01df5
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.
Why not a
data-dragging
modifier instead? I thought it was becoming a standard 🙂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.
@gabrieldutra +1
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 think because we don't use
data-
attributes anywhere except ofdata-test
. Also, IMHO class-based selectors are easier to read in CSS filesThere 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 use it all over the place 😬
Imo, as long as
data-prop1={condition || null}
, the selector is as coherent in the CSSThere 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.
Well, I think we need some convention for this 😁 I personally don't like (and avoid to use) attribute-based selectors for few reasons:
class
attribute is a list and may contain multiple values (the next class overrides rules of previous. Data attributes selectors usually are used by 1) presense 2) exact value - so classes are more flexible.I feel comfortable to use attributes for things that are standalone and "boolean" in their nature (like
disabled
property). In this case, we actually have two flags:draggable
which defines some styles for draggable container (another thing that feels wrong to me -draggable
flag should be set for element which is draggable itself), anddragged
which depends on and overrides some styles ofdraggable
- so actually these two attributes were used as classes - when second one extends/overrides previous one.Actually it's a quite good topic for discussion 🤔
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 think these are all good points.
I personally have not encountered these potential downsides, but I appreciate the thoughtfulness and am ok with the approach.
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.
🤔 personally I prefer the data attributes, but I haven't taken the opportunity to answer your arguments yet.
We should find a convention, but this shouldn't block this PR.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.