chore: Fix dialog scroll by #1694 change. (#1695)

This commit is contained in:
Jason Lee 2025-11-27 21:11:20 +08:00 committed by GitHub
parent 118a0f500e
commit 36b229068d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View file

@ -359,7 +359,8 @@ impl Render for DialogStory {
.on_click(cx.listener(move |_, _, window, cx| {
window.open_dialog(cx, move |dialog, window, cx| {
dialog
.h(px(450.))
.w(px(720.))
.h(px(600.))
.overlay(dialog_overlay)
.overlay_closable(overlay_closable)
.title("Dialog with scrollbar")

View file

@ -231,6 +231,14 @@ impl Dialog {
self
}
/// Sets the width of the dialog, defaults to 480px.
///
/// See also [`Self::width`]
pub fn w(mut self, width: Pixels) -> Self {
self.width = width;
self
}
/// Sets the width of the dialog, defaults to 480px.
pub fn width(mut self, width: Pixels) -> Self {
self.width = width;
@ -502,7 +510,7 @@ impl RenderOnce for Dialog {
.id("contents")
.pl(paddings.left)
.pr(paddings.right)
.overflow_scrollbar()
.overflow_y_scrollbar()
.child(self.content),
),
)