-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[TopBar] adopt search results to match width and alignment of input field #969
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. You can also join #polaris on the Shopify Partners Slack. |
b0e8685
to
852e2bb
Compare
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.
852e2bb
to
45984ae
Compare
45984ae
to
af2a917
Compare
af2a917
to
eb53401
Compare
eb53401
to
6531b03
Compare
c5df99c
to
67d203a
Compare
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.
Make sure that there are no magic numbers/calculations in there, otherwise this LGTM 👍 Thanks for picking this up @eliias! 💯
|
||
@include page-content-when-not-fully-condensed { | ||
align-items: flex-start; | ||
@include breakpoint-after(743px) { |
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.
743px
maybe store this in a variable somewhere
align-items: stretch; | ||
width: 100vw; | ||
height: calc(100vh - #{top-bar-height() + spacing(tight)}); | ||
top: top-bar-height() - spacing(); |
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.
Might wanna store this (or just the spacing()
part) in a variable to create clarity around how this calculation works.
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 feels pretty good now. I haven’t been able to properly 🎩 on mobile browsers due to Storybook, but the scaling across screen sizes works well. The results overlay does encroach on the user menu at the right; it doesn’t block it, but there’s a tradeoff here. @jakob-stecher you should take a look at make the final call on the alignment.
67d203a
to
baaa662
Compare
There was still a small issue w/ alignment on mobile. So we took the chance to also reposition the results a bit. Thx for review/polish @kvendrik. @ry5n I just used the iframe URL to test on iOS simulator http://localhost:6006/iframe.html?selectedKind=Playground&selectedStory=Playground |
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.
LGTM (one minor comment), Percy changes also make sense to me. If this looks good to @jakob-stecher and @ry5n I say let's 🚢 it.
@include breakpoint-after($large-width) { | ||
width: calc(100% - #{$search-results-desktop-large-width-offset}); | ||
} | ||
max-width: 70rem; |
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.
Maybe store these numbers somewhere to make them a little less magical.
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 have extracted both values into variables and got them hoisted to the top of the file.
baaa662
to
58c679a
Compare
Hey folks, we want to get this shipped w/ the next release of Polaris. Please provide your final feedback or please give it a thumbs up. @jakob-stecher @ry5n. |
58c679a
to
995c78a
Compare
🎉 Thanks for your contribution to Polaris React! |
WHY are these changes introduced?
This addresses some of the discussions that we had after this issue popped up #956 and is also a follow up of #852. The original PR did change the width of the search input field in the TopBar but did not apply those changes to the search results container. This looks a bit weird and this PR aligns the search result with the input field and also matches the width of the field.
WHAT is this pull request doing?
It sets the position rule to be relative on the search container. This allows us to match the width with the absolutely positioned search results container.
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist