-
Notifications
You must be signed in to change notification settings - Fork 373
feat(ExpandableSection): Allow more control over toggle icon #12051
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
Open
rebeccaalpert
wants to merge
1
commit into
patternfly:main
Choose a base branch
from
rebeccaalpert:expandable-icon
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+41
−7
Open
Changes from all 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 hidden or 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 hidden or 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.
Not 100% about allowing the icon to totally be removed since it kinda removes the indication that you can click to expand/collapse something as well as its current state. If the toggle text updates based on the state + the text indicates somehow that it expands/collapses something, then less of an issue probably.
Maybe if we just have the prop description mention that if an icon is omitted, we recommend the toggle text to indicate the current state of the expandable section. Should we also get design sign off on this?
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 is sort of what I'm thinking could be an issue:
I know this is expanded because I clicked it to expand it + knew it started as collapsed, but in other contexts it may not be clear that that is the case.
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.
We can add an error? My concern is that the consumer asked for a way for consumers to provide their own custom icon directly as part of the toggle content.
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 allowing a custom icon would be fine - I assume whatever icon they pass in would retain the transition between expanded and collapsed at least. I'd be more wary about allowing the removal of the icon entirely is all.
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.
Got it - let me bug them and see if they can get by with the smaller change.
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.
If we do want to allow removing the icon, then we need to just make sure we tell consumers that it's up to them to ensure the current state of the ExpandableSection is conveyed, most likely by having dynamic toggle text. Idk if it's always going to be clear whether content that follows the toggle is part of the expandable section or 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.
+1 to updating the prop description to note the additional details a user would need to convey the expanded/collapsed state.
I'm also fine with keeping the custom icon and removing the toggle. The benefit of keeping the toggle would be if a user wanted to customize where in the toggle the icon would go (passing it as a child), but we could also have an icon alignment start/end prop instead.