docs(modal): add playgrounds for sheet and card modal drag events#4415
docs(modal): add playgrounds for sheet and card modal drag events#4415thetaPC wants to merge 12 commits intofeature-8.8from
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
docs/api/modal.md
Outdated
|
|
||
| <CardExample /> | ||
|
|
||
| ### Drag Events for Card Modals |
There was a problem hiding this comment.
Originally I had the section titles just Drag Events on both sections but then the URLs were drag-events for Card and drag-events1 for Sheet. That seemed weird to me so I made the titles more unique.
There was a problem hiding this comment.
I like that idea. I can just use one of the modals. Most likely the sheet modal to show off what currentBreakpoint does.
ShaneK
left a comment
There was a problem hiding this comment.
Just a couple things that more or less depend on what you do with the framework PR
docs/api/modal.md
Outdated
| */ | ||
| currentY: number; | ||
| /** | ||
| * The change in Y position since the last event. |
There was a problem hiding this comment.
I'm not sure if this is a documentation issue or an implementation one, but the way this event is set up right now, deltaY is calculated since the gesture started, not the last event. It's also documented that way in your recent changes, which is why I think that's an issue here, not there
docs/api/modal.md
Outdated
| - `currentY` and `deltaY`: Track the absolute position and the change in distance since the last frame, useful for calculating drag direction. | ||
| - `velocityY`: Measures the speed of the drag, which can be used to trigger specific animations if a user "flicks" the modal. | ||
| - `progress`: A normalized value between 0 and 1 representing how far the modal is open. This is ideal for dynamically adjusting the opacity of an overlay or scaling background content as the modal moves. | ||
| - `currentBreakpoint`: For sheet modals, this identifies which breakpoint the modal will snap to if released at that moment. |
There was a problem hiding this comment.
Depending on what you do about this change request, this description may be incorrect because predicted breakpoints at higher velocities may not be where they actually stop if let go
Issue URL: internal
What is the current behavior?
The sheet and card modal can be dragged to view content. However, there are no events that determine when drag has started or ended.
What is the new behavior?
Does this introduce a breaking change?
Other information
Dev build:
8.7.17-dev.11772118942.181221d4