Skip to content

fix: lock page scroll when Dialog is open#450

Merged
lizidev merged 1 commit into
thaw-ui:mainfrom
chungwong:dialog_fix
May 7, 2026
Merged

fix: lock page scroll when Dialog is open#450
lizidev merged 1 commit into
thaw-ui:mainfrom
chungwong:dialog_fix

Conversation

@chungwong
Copy link
Copy Markdown
Contributor

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.
@lizidev lizidev merged commit 0726a3d into thaw-ui:main May 7, 2026
3 of 5 checks passed
@lizidev
Copy link
Copy Markdown
Collaborator

lizidev commented May 7, 2026

Thanks!

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.

2 participants