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): improve sheet modal scrolling and gesture behavior #29312

Merged
merged 2 commits into from
Apr 10, 2024
Merged

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Apr 9, 2024

Issue number: resolves #24583


What is the current behavior?

See #24583 (comment)

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 7.8.3-dev.11712695191.1d7ec370

Issue number: Part of
#24583

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

When a sheet modal is fully opened swiping down on the IonContent when
the content is scrolled to top does not move the sheet modal down. This
does not align with the card modal where doing the same actions causes
the card modal to move down.

 
## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Swiping down on the content now moves the sheet modal down as long as
the content is scrolled to the top.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.8.3-dev.11712114476.152fc43d`

Reviewers:

Please test this on physical iOS and Android devices. Please check the
following:

1. When a modal is fully opened, ensure that users can still scroll down
(i.e. swipe up on the content to scroll down).
2. When a modal is fully opened, ensure that users can swipe down on the
modal to dismiss when the content is scrolled to the top.
3. Repeat step 2 but ensure that swiping down scrolls content to the top
when content is NOT already scrolled to the top.


**Card Behavior**

| Demo |
| - |
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/910755c8-808e-4e0b-85d2-9a56a3b127c4"></video>
|

**Sheet Behavior**

| `main` | branch |
| - | - |
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/eb0b740f-b644-4602-93f9-8c634458239b"></video>
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/3844983e-ebbc-43f3-b5c2-20aad738b201"></video>
|
Issue number: Part of
#24583

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

There is a noticeable delay between when users finish swiping and when
scrolling is re-enabled. This is because the animation takes ~500ms to
complete when finishing the swipe.

This does not align with how we [re-enable scrolling in the card
modal](https://github.com/ionic-team/ionic-framework/blob/9b3cf9fbc2c5189871b2255d2d765e78509f5027/core/src/components/modal/gestures/swipe-to-close.ts#L262-L264).
In the card modal, scrolling is re-enabled as soon as the gesture is
released.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- To fix this, I aligned the behavior of the sheet modal with that of
the card modal. As a result, whether or not the content is scrollable is
now tied to the state of the gesture rather than the state of the
animation.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.8.3-dev.11712114476.152fc43d`

Reviewers:

Please test this on a physical iOS and Android devices. Ensure that
swiping the modal fully open does a) re-enable scrolling and b)
re-enable scrolling without a 500ms delay.

**Card Behavior**

| Demo |
| - |
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/175c5721-b694-45bf-9acf-044214d979c9"></video>
|

**Sheet Behavior**

| `main` | branch |
| - | - |
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/a6d5fffd-57a5-4d43-9856-dc28dced5417"></video>
| <video
src="https://github.com/ionic-team/ionic-framework/assets/2721089/797395e9-f455-4a0b-87a3-b2f72c50afab"></video>
|
Copy link

vercel bot commented Apr 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 8:50pm

@github-actions github-actions bot added the package: core @ionic/core package label Apr 9, 2024
@liamdebeasi liamdebeasi changed the title Fw 621 fix(modal): improve sheet modal scrolling and gesture behavior Apr 9, 2024
@liamdebeasi liamdebeasi marked this pull request as ready for review April 9, 2024 20:49
@liamdebeasi liamdebeasi requested a review from a team as a code owner April 9, 2024 20:49
@liamdebeasi liamdebeasi added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit 9738228 Apr 10, 2024
58 checks passed
@liamdebeasi liamdebeasi deleted the FW-621 branch April 10, 2024 17:34
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: scrolling issues with bottom sheet modal
2 participants