feat(modal): add drag events for sheet and card modals#30962
feat(modal): add drag events for sheet and card modals#30962brandyscarney merged 30 commits intofeature-8.8from
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| /** | ||
| * While the gesture animation is finishing | ||
| * it is possible for a user to tap the backdrop. | ||
| * This would result in the dismiss animation | ||
| * being played again. Typically this is avoided | ||
| * by setting `presented = false` on the overlay | ||
| * component; however, we cannot do that here as | ||
| * that would prevent the element from being | ||
| * removed from the DOM. | ||
| */ | ||
| this.gestureAnimationDismissing = true; | ||
|
|
||
| /** | ||
| * Reset the status bar style as the dismiss animation | ||
| * starts otherwise the status bar will be the wrong | ||
| * color for the duration of the dismiss animation. | ||
| * The dismiss method does this as well, but | ||
| * in this case it's only called once the animation | ||
| * has finished. | ||
| */ | ||
| setCardStatusBarDefault(this.statusBarStyle); | ||
| this.animation!.onFinish(async () => { | ||
| await this.dismiss(undefined, GESTURE); | ||
| this.gestureAnimationDismissing = false; | ||
| }); |
There was a problem hiding this comment.
This was moved to a new function called cardOnDismiss()
There was a problem hiding this comment.
Screenshots updated because a new button and a new header was added behind the modal.
There was a problem hiding this comment.
When adding new events to an overlay, we need to also add them to this file else devs won't be able to use them within a tag like @ionDragStart.
ShaneK
left a comment
There was a problem hiding this comment.
Just looked at this again and noticed a few issues with the Angular implementation
| 'didPresent', | ||
| 'willPresent', | ||
| 'willDismiss', | ||
| 'didDismiss', |
There was a problem hiding this comment.
I think you need to add the new events (ionDragStart, ionDragMove, and ionDragEnd) here for them to work properly
There was a problem hiding this comment.
Co-authored-by: Shane <shane@shanessite.net>
brandyscarney
left a comment
There was a problem hiding this comment.
Looks good now! Just a few comments related to comments, nothing major.
Issue number: resolves 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?
ionDragStart,ionDragMove,ionDragEndDoes this introduce a breaking change?
Other information
Dev build:
8.7.17-dev.11772118942.181221d4