-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Filters] only show the "More filters" button if necessary #2856
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
Conversation
|
👋 Thanks for opening your first pull request. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines. |
|
🟢 This pull request modifies 7 files and might impact 2 other files. Details:All files potentially affected (total: 2)📄
|
src/components/Filters/components/ConnectedFilterControl/ConnectedFilterControl.tsx
Outdated
Show resolved
Hide resolved
src/components/Filters/components/ConnectedFilterControl/ConnectedFilterControl.tsx
Outdated
Show resolved
Hide resolved
bbe9958 to
46005d4
Compare
|
I like the approach, only show more filters if there are actually more filters! 😄 There is some polishing work to do. A couple things I noticed from a quick 🎩 are: |
tmlayton
left a comment
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.
See above comment
|
Hi @tmlayton I just addressed you comments. Let me know what you think! |
|
Hi tim! @tmlayton I just address the border-radius problem. Let me know what you think! |
|
Looks good! |
a1fdf6c to
26a002a
Compare
|
For test coverage run Looking at the codecov diff the lines without coverage are flagged in yellow for partial or red for none: Adding tests for this is fairly straightforward. The two cases are when |
tmlayton
left a comment
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.
Couple small changes, otherwise this is ready to go. I went ahead and pushed a couple more tests for code coverage.
e64eef5 to
06945aa
Compare
…opify/polaris-react into hide_more_filters_button_prop
|
🎉 Thanks for your contribution to Polaris React! |





WHY are these changes introduced?
Fixes #2826
The filters component always shows a "More filters" button. If there's only one filter or we can fit all the filters in the container, the button feels unnecessary.
This image describes the problem:
Notice how there's only one filter, and we still show the "More filters" button.
WHAT is this pull request doing?
This PR introduces the following behaviour:
shortcut: truewe show theMore filtersbuttonshortcut: trueand we can fit them in the container, we don't show theMore filtersbuttonshortcut: trueand we CAN'T fit them in the container, we show theMore filtersbuttonshortcut: truebut no all, we show theMore filters buttonThis shows the new look:

The changes are backwards compatible.
🎩 checklist
README.mdwith documentation changes