feat: Add support for new <Drawer.SnapPoint />
#548
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.
Problem
Hard coded
snapPoint
values are not ideal for responsive drawers. In the video bellow, notice how the snap point is not consistently under the "Buy" button when the screen is smaller.CleanShot.2025-02-12.at.01.19.06.mp4
Solution
Introduce a new
Drawer.SnapPoint
component to determine where the snaps occur based on their position in the DOM. This solution was inspired by this issue #330Caution
Although functional, this PR is still a WIP as I find time to contribute.
Todo
<Drawer.SnapPoint />
offset
prop in<Drawer.SnapPoint />
test
appWishlist
name
prop in<Drawer.SnapPoint />
snapPoints
prop to combine both hard coded and embedded snap points