Make context and dropdown menus scrollable (#15127)

This PR makes context and dropdown menus scrollable, so that they don't
become totally unusable when they overflow the window.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-07-24 18:43:01 -04:00 committed by GitHub
parent 4e88a08ed4
commit 8501ae6a19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -311,7 +311,10 @@ impl Render for ContextMenu {
div().occlude().elevation_2(cx).flex().flex_row().child(
WithRemSize::new(ui_font_size).flex().child(
v_flex()
.id("context-menu")
.min_w(px(200.))
.max_h(vh(0.75, cx))
.overflow_y_scroll()
.track_focus(&self.focus_handle)
.on_mouse_down_out(cx.listener(|this, _, cx| this.cancel(&menu::Cancel, cx)))
.key_context("menu")