Skip to content

feat: sheet/card modal emit drag #23955

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

Open
3 tasks done
EinfachHans opened this issue Sep 20, 2021 · 17 comments
Open
3 tasks done

feat: sheet/card modal emit drag #23955

EinfachHans opened this issue Sep 20, 2021 · 17 comments
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement

Comments

@EinfachHans
Copy link
Contributor

Prequisites

Describe the Feature Request

If a FR like this already exist, please close, but i didn't found one.

It would be great to be able to "dig" into Animations and Gestures that are used in the Ionic Framework.

Describe the Use Case

It would allow us to show, hide or transform & animate stuff in the app while the user performs something. For example with the new sheet style modal we could fade content in or out if the modal is dragged up or dragged down.

Also this can be used for navigation animations.

Describe Preferred Solution

I guess this is kinda tricky, as this can be either defined globally or per component.

For example if i want to implement this for a Modal it must be possible for me to add this in the Component that the Modal uses like

this.modal.animation.subscribe()

Describe Alternatives

Currently i think something like this is possible if we copy/paste all the animations/gestures from ionic into our app and modify to call a handler, but this is not very good, as it doesn't update the animations if you update it internally 🤔

Related Code

No response

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Sep 20, 2021
@liamdebeasi
Copy link
Contributor

Can you please clarify what it means to "dig into an animation" in Ionic? It sounds like you are looking to get drag events emitted from the modal with the sheet gesture?

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Sep 20, 2021
@ionitron-bot ionitron-bot bot removed the triage label Sep 20, 2021
@EinfachHans
Copy link
Contributor Author

Yes exactly. But not only the Drag Gesture and not only the Sheet Modal. If for example (when possible in the future) the sheet modal is changed via a function it should also executy my listener to perform my animations.

Or if we talk about Page Transistions this should work on the first navigate, as well on the navigate back or swipe to go back.

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Sep 20, 2021
@liamdebeasi
Copy link
Contributor

liamdebeasi commented Sep 20, 2021

Some of these animations/transitions are not meant to be extended/customized, so I would prefer not to add this feature to every animation unless we have use cases for each one.

The sheet modal use case makes sense (we have also had people ask about this internally), so I think we can add that one.

@liamdebeasi liamdebeasi changed the title feat: dig into ionic animations / gestures feat: sheet modal emit drag Sep 20, 2021
@liamdebeasi liamdebeasi added package: core @ionic/core package type: feature request a new feature, enhancement, or improvement labels Sep 20, 2021
@ionitron-bot ionitron-bot bot removed the triage label Sep 20, 2021
@EinfachHans
Copy link
Contributor Author

Yeah maybe every animation was too much 😃 But i wouldn't limit this on sheet modals, we could start with modals in generall?

@liamdebeasi
Copy link
Contributor

How would regular modals benefit from the drag event?

@EinfachHans
Copy link
Contributor Author

I think of the Card style modal which is also swipable, so here it wouldn't be showing or hiding more or less content, it would be more having the posibility to do cool animations when draging the modal away

@liamdebeasi
Copy link
Contributor

Thanks -- makes sense to have this work for card modal too.

@liamdebeasi liamdebeasi changed the title feat: sheet modal emit drag feat: sheet/card modal emit drag Sep 20, 2021
@JulesLagadic
Copy link

Hello,
Any news about this issue? Would be amazing to get a way to subscribe to the drag event... Any workaround possible?

@sean-perkins
Copy link
Contributor

Added additional thoughts here: #25127 (comment)

Summary: We should add a dragEvents property to ion-modal, to allow developers to subscribe to the drag events for both card and sheet modals. Sheet modals should likely include information related to the breakpoint as well.

@sean-perkins
Copy link
Contributor

sean-perkins commented Jun 10, 2022

Found an example of where this feature could be leveraged in Instagram's app:

RPReplay_Final1654890612.mp4

They center the active location in the middle of the content behind the sheet modal, when the sheet modal begins to drag.

@JulienLecoq
Copy link

I also needs that to be able to hide dynamically some content when a modal is dragged 👍🏻

@sean-perkins
Copy link
Contributor

Airbnb has UI that would require this feature, where the tab bar is moved off screen as the sheet modal is dragged.

RPReplay_Final1688609862-final.mp4

@greg-md

This comment was marked as off-topic.

@aeharding
Copy link
Contributor

Another use case: I would like to have a dragStart and dragEnd events on card modal to open and close the keyboard.

@Sovai

This comment was marked as off-topic.

@ijsje71
Copy link

ijsje71 commented Apr 9, 2025

I also need these drag events on the modals for another use case. Is this feature in the pipeline right now?

@thetaPC @ShaneK @brandyscarney

@thetaPC
Copy link
Contributor

thetaPC commented Apr 9, 2025

@ijsje71 Appreciate your interest! We're always working on a variety of improvements and new features. No updates to share just yet, but keep an eye on this thread for any future news.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

No branches or pull requests

10 participants