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(ui5-dynamic-page): prevent unwanted header toggle from scroll #10007

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NakataCode
Copy link
Contributor

@NakataCode NakataCode commented Oct 10, 2024

Issue:

  1. The snapTitleByScroll function, triggered by scroll events, interfered with user-triggered actions such as onExpandClick and onToggleTitle. This caused the header to snap or close unexpectedly after being manually expanded.
  2. In the "inbetweener" state (between SCROLL_THRESHOLD and headerHeight), the header wasn't properly unsnapping.

Solution:

  1. An isToggled flag was introduced to temporarily prevent the snapTitleByScroll function from running right after a user-triggered toggle. This ensures that snapTitleByScroll doesn't fire immediately after a manual action. Once the user toggle is complete, the flag is reset, allowing normal scroll-based snapping to resume without conflict.
  2. Added showHeaderInStickArea state synchronization when setting scrollTop to 0 in the inbetweener state, ensuring immediate and correct snap behavior on subsequent scrolls.

Fixes: #9961

@NakataCode NakataCode marked this pull request as ready for review October 10, 2024 13:16
@NakataCode NakataCode force-pushed the dynamic-page-handle-header-toggle branch from 4924d4b to f8c255d Compare October 24, 2024 10:17
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.

[Dynamic page]: Clicking on the 'Expand Header' button doesn't work every time
1 participant