-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Filters] Fix FilterTrigger class to clear margins #2292
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
[Filters] Fix FilterTrigger class to clear margins #2292
Conversation
4316fee
to
e3a91cc
Compare
While creating a fix for this issue, I discovered that the |
123f7e2
to
c109701
Compare
UNRELEASED.md
Outdated
- Fixed `recolor-icon` Sass mixin to properly scope `$secondary-color` to the child `svg` ([#2298](https://github.com/Shopify/polaris-react/pull/2298)) | ||
- Fixed a regression with the positioning of the `Popover` component ([#2305](https://github.com/Shopify/polaris-react/pull/2305)) | ||
- Fixed issue with `Filters` component displaying an undesired margin top and bottom | ||
on the button element on Safari ([2292](https://github.com/Shopify/polaris-react/pull/2292)) |
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.
on the button element on Safari ([2292](https://github.com/Shopify/polaris-react/pull/2292)) | |
on the button element on Safari ([#2292](https://github.com/Shopify/polaris-react/pull/2292)) |
Thanks for doing this @shui91. To answer your question, I think what you did here is the best approach. No need to use |
c109701
to
33e44a0
Compare
@dleroux thanks for following up on this and the comment on the other issue! I'll make another PR for that one soon :) Appreciate the help! |
@shui91 sorry about that, there was a release last week, therefore, more conflicts on the unreleased.md. |
33e44a0
to
9ebc27f
Compare
@dleroux resolved |
9ebc27f
to
0a3e155
Compare
@shui91 looks like there are still some entries that we're in the previous release. |
- on Safari the button element with FilterTrigger class was displaying 2px of margin top and bottom due to some global button rules; since the original implementation seems to expect 0 margin on this button and because this only happens on Safari, I added a rule to explicitly set margin to 0 - on a side note, it seemed like overkill to use the `unstyled-button` mixin so I opted for the single margin rule, but it could make sense to use the mixin since we want to reset this button element to an 'unstyled' state. - update UNRELEASED.md
- rebase to get up to date with master branch
0a3e155
to
6b5fe23
Compare
@dleroux Happy New Year! I've fixed the merge conflicts by rebasing master onto my branch. Hope this will do it now :) |
@shui91 Happy new year to you! Unfortunately, old entries are still in The only change in there should be yours. Sorry to do this to you, we really do appreciate the contribution! Thanks again. |
- due to my fix branch being out of sync for a while, the previous unreleased fixes were already released so they needed to be removed
Ohhh gotcha! I didn't catch that the other fixes had already been released. 😅 |
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.
🎉 🙇 @shui91 Thank You!
WHY are these changes introduced?
Fixes #2286
On Safari, there is 2px of
margin-top
andmargin-bottom
being applied to theFilterTrigger
button in theFilter
component.WHAT is this pull request doing?
FilterTrigger
classsince there is already no margin on Chrome/FireFox, it seemed like a
sensible solution to explicitly ensure there is no margin applied regardless
of browser.
unstyled-button
mixin so I opted for the single margin rule,
but it could make sense to use the mixin since we want to reset this
button element to an 'unstyled' state.
Question for Code Owners:
What would be the best practice for this Design System in this case? To use the
unstyled-mixin
and removing the duplicated rules such asbackground
andborder
or just adding themargin
rule like I've done in this PR?In the case of using the
unstyled-mixin
the browser will warn that there are duplicate properties and I'm not sure if that's following best practices for this project. i.e in the screenshot belowpadding
is duplicated as a result of usingunstyled-mixin
after removingbackground
andborder
.Before/After Images
Before:After:

Copy-paste this code in
playground/Playground.tsx
:🎩 checklist
README.md
with documentation changes