-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(accordion): clickable title #1033
Merged
TylerR909
merged 4 commits into
main
from
sc-51723/designpackage-zoomed-out-multislot-view
May 29, 2024
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Suggestion: We should try to avoid nesting interactive elements. Per HTML standards, nesting of interactive elements is not permitted- it's possible, just not advisable.
https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element
Please work with design to determine a way forward where we do not nest interactive elements. We could have buttons side by side, or just make the chevron the click target for expanding/collapsing.
I used to be pretty adamant with the old design crew about avoiding these patterns, and we've been successful so far. I'd like us to keep up with enforcing HTML standards back onto design and share the knowledge.
Fwiw, here's what GPT had to say about it:
Nesting a
<button>
element inside another<button>
element is invalid HTML according to the HTML5 specification. This is because:Semantic Incorrectness: Buttons are meant to be interactive elements, and nesting one interactive element inside another can create confusion about which element should be interactive.
Accessibility Issues: Screen readers and other assistive technologies may have difficulty interpreting nested buttons, leading to poor user experiences for individuals relying on these tools.
Browser Compatibility: Different browsers may handle nested buttons inconsistently. Some browsers may ignore the nested button, while others may render it in unexpected ways, leading to unpredictable behavior.
Event Handling Confusion: Nesting buttons can create complications in event handling. For instance, click events might not propagate as expected, causing issues in the functionality of the nested buttons.
To maintain valid, accessible, and predictable HTML, it's best to avoid nesting
<button>
elements inside each other.