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

fix(modal): sheet is easier to dismiss with swipe #25883

Merged
merged 18 commits into from
Sep 9, 2022
Merged

fix(modal): sheet is easier to dismiss with swipe #25883

merged 18 commits into from
Sep 9, 2022

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Sep 6, 2022

⚠️ Note to reviewer: Please test manually on a device. This fix depends on how quickly you swipe which cannot be easily tested on CI.

Dev build: 6.2.6-dev.11662502742.1ac13490

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue URL: resolves #24296
Given a sheet modal with breakpoints of [0, 1], it is very difficult to dismiss the sheet. Developers need to swipe more than 50% of the way down the screen in order for it to dismiss.

What is the new behavior?

  • Aligned the threshold variable with that of the card modal so that short but quick swipes can also dismiss the modal.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@liamdebeasi liamdebeasi changed the title fix(modal): sheet is easier to dismiss via swipe fix(modal): sheet is easier to dismiss with swipe Sep 6, 2022
@github-actions github-actions bot added the package: core @ionic/core package label Sep 6, 2022
@liamdebeasi liamdebeasi marked this pull request as ready for review September 6, 2022 13:35
@liamdebeasi liamdebeasi requested a review from a team as a code owner September 6, 2022 13:35
Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After checking out FW-389 and running modal/test/sheet on a native design with the test modified for:

        <ion-button id="custom-breakpoint-modal" onclick="presentModal({ initialBreakpoint: 1, breakpoints: [0, 1] })">
          Present Sheet Modal (Custom Breakpoints)</ion-button>

I am observing that no snapping behavior is working. The sheet modal is free dragging to any value.

@liamdebeasi
Copy link
Contributor Author

Can you pull latest + restart your dev server? The snapping is working on my end.

RPReplay_Final1662479950.mp4

@sean-perkins sean-perkins self-requested a review September 6, 2022 16:45
Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good on device. The threshold does feel sensitive when using breakpoint values of [0, 0.5, 1] and dragging down from 1. You have to be deliberate in your sensitivity to snap to the 0.5 breakpoint.

@liamdebeasi
Copy link
Contributor Author

Good catch. I reduced the sensitivity such that it feels better for both case. Mind giving it another try?

@sean-perkins
Copy link
Contributor

Thoughts on bumping from 250 to 350? With 250, I could rarely get the sheet to dismiss with [0, 0.5, 1] and the current breakpoint at 1.

500+ felt too sensitive (still resulting in accidental dismisses when trying to drag to the 0.5 breakpoint. 350 inherently felt better in Mobile Safari (XS Max)

@liamdebeasi
Copy link
Contributor Author

Agreed, 350 feels much better. Fixed in 71c6784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: sheet should allow for short but quick swipes to move to between breakpoints
2 participants