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

Improve BottomSheet behavior for dynamic content and animation states #2108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryskin
Copy link

@ryskin ryskin commented Jan 10, 2025

This commit enhances the BottomSheet component to better handle dynamic content changes and animation states. Key changes include:

  • Added logic to manage the initial mount and dynamic content changes.
  • Improved handling of closed states and snap point changes.
  • Ensured that the closest snap point is returned when necessary.
  • Refined the conditions under which the flag is set.

Risks:

  • Potential regressions in existing animation behavior if not thoroughly tested.
  • Changes may introduce unexpected behavior in edge cases related to snap points.

Benefits:

  • Improved user experience with more responsive and accurate positioning of the BottomSheet.
  • Enhanced maintainability and clarity of the code regarding animation states.

Please provide enough information so that others can review your pull request:

Motivation

Fix Bottom Sheet Content Height Issues

Overview

This PR fixes an issue where the bottom sheet would unexpectedly close when its content height changes. The current implementation incorrectly handles snap point changes during content updates, causing the sheet to close instead of maintaining its position.

Key Problems Addressed

  • Unwanted sheet closure during content height changes

Solution

The patch improves position evaluation logic and adds proper state management to ensure the bottom sheet maintains expected behavior during content updates while preserving intended open/close functionality.

Additional Changes

  • Added debugging logs to help track sheet behavior for future troubleshooting if needed

This commit enhances the BottomSheet component to better handle dynamic content changes and animation states. Key changes include:

- Added logic to manage the initial mount and dynamic content changes.
- Improved handling of closed states and snap point changes.
- Ensured that the closest snap point is returned when necessary.
- Refined the conditions under which the  flag is set.

**Risks:**
- Potential regressions in existing animation behavior if not thoroughly tested.
- Changes may introduce unexpected behavior in edge cases related to snap points.

**Benefits:**
- Improved user experience with more responsive and accurate positioning of the BottomSheet.
- Enhanced maintainability and clarity of the code regarding animation states.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant