-
Notifications
You must be signed in to change notification settings - Fork 13
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
va-pagination: add resize listener to adapt to mobile devices and zoomed layouts #1476
Open
1Copenut
wants to merge
34
commits into
main
Choose a base branch
from
tpierce-2199-bug-va-pagination
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.
Open
Changes from 14 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
e7ece77
First commit to confirm ResizeObserver triggers.
1Copenut 2fcec36
Renamed state variables. Refactored magic numbers to instance constants.
1Copenut 06efa84
Updated Storybook instances and e2e tests.
1Copenut 0821778
Refactored prev, next, first, last logic to private functions.
1Copenut 39ab503
Moved renderPages to a private function outside render.
1Copenut ff05f59
Commented and refactored pageNumbers func for logic readability.
1Copenut 68c8926
Added return types to new render UI functions.
1Copenut f6a8145
Updated stories to 6 as lower bound.
1Copenut db09b81
Adding a CSS override for ellipses at smallest breakpoint.
1Copenut aca4288
Added a debounce method to utils.
1Copenut 8b747eb
Added debounce to resizeObserver. Changed constant names for descript…
1Copenut 5e57916
Added tests to check for ellipses on small screens.
1Copenut 014a83a
Swapped conditional classname for container query.
1Copenut 55e0362
Merge branch 'main' into tpierce-2199-bug-va-pagination
1Copenut 02a20d3
Update packages/web-components/src/components/va-pagination/va-pagina…
1Copenut abc397c
Removing render function comment blocks.
1Copenut 5b51cff
WIP. Refactoring use case 2 to use switch statement.
1Copenut 8730cea
WIP. Refactoring use case 3 to use switch statement.
1Copenut 009dfa3
Adjusted logic for handing off from last with one ellipsis to middle.
1Copenut 4b4bc7a
Removing maxListLengthState. No longer needed with new logic tree.
1Copenut 61b55e4
Added logic for 6-9 pages. Removed console.log statements.
1Copenut 937c86f
WIP. Added logic for middle page starts.
1Copenut 330beb4
Further improvements for use cases 3 and 4.
1Copenut 7236bb7
Use case 1 confirmed correct.
1Copenut 3388b43
Use case 3 confirmed correct.
1Copenut 714a2a9
Use case 4 confirmed correct.
1Copenut 605599d
Use case 2 confirmed correct.
1Copenut 186dabc
Use case 5 confirmed correct. Added isTabletViewport state.
1Copenut 8f5b4a2
Final cleanup and comment removal.
1Copenut 41cc266
Added e2e tests for mobile, small tablet viewport widths.
1Copenut 67a6e5d
Updated the SCSS comment explaining magic number in container query.
1Copenut 0aba699
Refactoring high counts starting at 1 for mobile devices.
1Copenut 5ca3781
Fixing two e2e tests for small viewport.
1Copenut 19f2ee6
Merge branch 'main' into tpierce-2199-bug-va-pagination
1Copenut 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 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 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 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.
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.
What does this mean?
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 was having quite a time passing the USWDS
$tablet
variable into this container query. I triedvar(--tablet)
and$tablet
and#${tablet}
but they either wouldn't render the CSS rule at all, or failed during compilation. Happy to change it if there's something I'm missing.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.
That's really interesting 🤔 I wonder if that's a Stencil limitation? Thanks for explaining!
Do you mind just mentioning in the comment that the value is for the
--tablet
variable/property?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 it's a limitation in Sass. I found this article Want CSS variables in media query declarations? Try this! that digs into the specifics of Sass variables in media and container queries. I'll update the comment explaining the issue.