Skip to content

bug: ion-modal does not reset breakpoint value on dismiss  #25245

Closed
@sean-perkins

Description

@sean-perkins

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

When using inline an inline sheet modal, when the sheet modal is dismissed the breakpoint value remains as the value before it was dismissed.

This is problematic in situations where the sheet modal can be presented again, as the state of the modal will not be reflective of the visual state of the screen.

This will also distort the transition when you re-open the sheet modal and try to drag to a new breakpoint.

Expected Behavior

When the sheet modal is dismissed, the internal currentBreakpoint value should be set to the initialBreakpoint value. This way when the sheet is re-presented, the internal state will match the visual state.

Steps to Reproduce

Following the Stackblitz example:

  1. Click the button to open the sheet modal
  2. Click the search bar to call logic to move to the 0.75 breakpoint.
  3. Notice the breakpoint does change / modal animates
  4. Click outside of the sheet modal to dismiss it
  5. Click the button again to present the sheet modal
  6. Notice the visual breakpoint is 0.25
  7. If you log the getCurrentBreakpoint() value of the ion-modal reference it will be 0.75
  8. Click the search bar again
  9. Notice the sheet does not change position, as the check that compares the current breakpoint vs. the new breakpoint will return early

Code Reproduction URL

https://stackblitz.com/edit/mrg5um

Ionic Info

N/A

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions