-
Notifications
You must be signed in to change notification settings - Fork 534
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
<UnderlineNav>
menu now uses the Anchored Position on smaller screen sizes to not clip, or go out of bounds.
#4234
<UnderlineNav>
menu now uses the Anchored Position on smaller screen sizes to not clip, or go out of bounds.
#4234
Conversation
🦋 Changeset detectedLatest commit: bc5a69f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Sorry 🙏 . I seem to have done a wonky-merge. Recreated the PR, feedback and conversation can be found here. |
Copy+Pasting my last message: Woop woop! 🎉 Thank you a billion for the feedback, @broccolinisoup. It really helps with the implementation and understanding what the aim is 🙏. Here's how I suggest we fix this: I kind of like the margin: 0 solution which forces the menu to the right. It is simple and works. However, when the container does not offer enough room (as the more button is left-aligned), I suggest we use getAnchoredPosition like you suggested. I've updated the code to do the following:
Again, thanks for the feedback! If I missed something, or, misunderstood something - please let me know and ill get to it 🙏 |
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.
Hello @Rebstorm 👋🏻 Thanks so much for following up with the review comments 🙏🏻
I love your thinking on the solution! This is great. I have two main comments, one is about the position of the menu and the other is the styling performance. Please let me know if there is anything I can elaborate or if I misunderstand anything from your suggested solution. Thanks so much for your time and your contribution 🙏🏻
To summarize the current fix, based on @broccolinisoup's feedback:
Again, thank you for a clear response and great feedback. This has been fun working on (and I hope it did not cause too much overhead for you), and if there's something missing - let me know! |
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.
Thanks so much for following up with the comments and pushing this PR to the end @Rebstorm! It looks great 🎉
Just a note: I'll hold off merging this (this is why I am commenting on the PR instead of approving) for a few days to test some action issues on the fork PRs.
Thanks again for raising this pull request and contributing to Primer 🥳 🎈
@joshblack I was testing #4235, it cancels the deploy preview (fork) action in this PR. Do you happen to know why that is failing to run? Also what is the best way you recommend to debug cancelled actions? I usually have a hard time debugging them, well, because there is not much proper logs 🫠 |
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.
Hi @Rebstorm 👋🏻 Apologise for the delay here. I am going ahead merging the PR 🎉
Thanks so much again for your contribution 🙏🏻
…n sizes to not clip, or go out of bounds. (#4234) * fix & tests * Create tricky-moose-design.md * fixes with @broccolinisoup 's feedback * type-only import BetterSystemStyleObject --------- Co-authored-by: Armagan Ersoz <broccolinisoup@github.com>
Closes #4059
Changelog
New
This PR fixes the issue with the
<UnderlineNavMenu>
on smaller screens using the menu. Where it would normally overflow to the left, this makes sure we align the absolute item using the AnchoredPosition API that you have provided.Old Behavior:
New Behavior (321px >):
On very small screens (not supported, but hey - why not):
Changed
menuStyles
in the<UnderlineNav>
It has become more complex, as the style has become complex as well. I am forced to check now for how many pixels we have available in the
listRef
. I am also using thegetAnchoredPosition
API now to calculate the position of the element, but only for smaller screens, as to not mess with themin-width
that was previously set.Removed
Rollout strategy
Testing & Reviewing
Merge checklist