Skip to content

fix: lock page scroll when Dialog is open#450

Open
chungwong wants to merge 1 commit intothaw-ui:mainfrom
chungwong:dialog_fix
Open

fix: lock page scroll when Dialog is open#450
chungwong wants to merge 1 commit intothaw-ui:mainfrom
chungwong:dialog_fix

Conversation

@chungwong
Copy link
Copy Markdown

It mainly fix two things on dialog with scrollable(long in height) page. The demo didn't show these problems as it is using

  1. When the dialog shows, it doesn't prevent the underneath content from scrolling, i.e. when you scroll, the content underneath the backdrop scrolls
  2. When the dialog shows or hides, the width of the scrollbar affect the page width and cause the content to shift twice
    a. once when the dialog shows, as the scrollbar is hidden
    b. another when the dialog hides, as the scrollbar is shown.

Call use_lock_html_scroll in Dialog, same as OverlayDrawer.
Compensate for scrollbar width to prevent layout shift.
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