Skip to content
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

feat: swipe to close modal from content #22046

Closed
nielsdewulf opened this issue Sep 8, 2020 · 13 comments · Fixed by #25185
Closed

feat: swipe to close modal from content #22046

nielsdewulf opened this issue Sep 8, 2020 · 13 comments · Fixed by #25185
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@nielsdewulf
Copy link

nielsdewulf commented Sep 8, 2020

Feature Request

Ionic version:

[x] 5.3.2

Describe the Feature Request

Expose swipe back gesture for customization at https://github.com/ionic-team/ionic-framework/blob/master/core/src/components/modal/modal.tsx#L29 . I wish to change the canStart function to disable the gesture when scrolling still needs to happen in the ion-content. If its scrolled to the top, the gesture can happen.

Describe Preferred Solution

Allow to give a custom createSwipeToCloseGesture to the Modal.

Describe Alternatives

Allow to change the individual gesture functions in the already made swipeToCloseGesture

Related Code

Additional Context

@ionitron-bot ionitron-bot bot added the triage label Sep 8, 2020
@liamdebeasi
Copy link
Contributor

Thanks for the feature request. Can you please describe your use case for this feature?

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Sep 8, 2020
@ionitron-bot ionitron-bot bot removed the triage label Sep 8, 2020
@nielsdewulf
Copy link
Author

Hi @liamdebeasi, I want to create a custom SwipeToCloseGesture. The issue persists when you have scrollable content inside the modal and you use the gesture. It doesn't work since the canStart function inside the gesture returns false when the target is ion-content. I wish to override the canStart function so that I can check if the scrollable content is scrolled to the top. If that's the case I want to allow the gesture so that the modal can be swiped away.

Hope this clarifies my situation a bit more.

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

From what it sounds like, you want to be able to swipe to close the modal from the content only if the content is scrolled to the top?

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Sep 8, 2020
@ionitron-bot ionitron-bot bot removed the triage label Sep 8, 2020
@nielsdewulf
Copy link
Author

nielsdewulf commented Sep 8, 2020 via email

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

Thanks - that use case makes sense. There is an open PR that adds this functionality: #21227. There are still some issues with it, so I may work on it myself. I think I would rather add this than expose the entire gesture though.

@liamdebeasi liamdebeasi changed the title feat: Expose swipe back gesture for customisation feat: swipe to close modal from content Sep 9, 2020
@liamdebeasi liamdebeasi added package: core @ionic/core package type: feature request a new feature, enhancement, or improvement labels Sep 9, 2020
@ionitron-bot ionitron-bot bot removed triage labels Sep 9, 2020
@simion
Copy link

simion commented Sep 10, 2020

I was looking for something similar myself :)
Swipeable modals in ios can be swiped down by pilling the content, if scroll has reached top.
Something similar on ionic would be awesome :)

@laocker96
Copy link

laocker96 commented Jun 3, 2021

Sorry guys this is not working for me ... I'm using IonContent inside an IonModal with swipeToClose={true} Is this currently working or still being fixed?

-----------------------------------------------------------
IONIC VERSION: @ionic/react: 5.5.4

@liamdebeasi
Copy link
Contributor

This has not been resolved. When it is, this issue will be closed and you should receive an email notification.

@laocker96
Copy link

laocker96 commented Jun 3, 2021 via email

@liamdebeasi liamdebeasi added type: bug a confirmed bug report and removed type: feature request a new feature, enhancement, or improvement labels Nov 23, 2021
@katche70
Copy link

katche70 commented Feb 1, 2022

This would indeed be a great feature

@liamdebeasi liamdebeasi added type: bug a confirmed bug report and removed type: bug a confirmed bug report labels Mar 31, 2022
@liamdebeasi
Copy link
Contributor

liamdebeasi commented Apr 22, 2022

Hi everyone,

I am working on implementing this with the card style modal. Can everyone test this dev build and let me know if you run into any issues?

6.1.3-dev.11650987132.14e7a957

Note: This dev build applies to any Ionic Framework package (vue, angular, etc).

@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #25185, and a fix will be available in an upcoming release of Ionic Framework.

Please feel free to continue testing, and let me know if you run into any issues.

@ionitron-bot
Copy link

ionitron-bot bot commented May 27, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
5 participants