-
Notifications
You must be signed in to change notification settings - Fork 479
Open
Description
Description
When using a list inside a popover, the popover is closed on the list’s blur event. However, blur fires before the list item’s on_click, so clicking an item never triggers the click handler. Would using on_mouse_down instead of on_click be the correct approach?
Environment
- GPUI: main [83ca310]
- GPUI Component: main [be65753]
- Platform: [macOS 26]
Steps to Reproduce
- code example
Popover::new("popover-recent-projects")
.max_w(px(600.))
.trigger(
Button::new("recent-proejcts-trigger")
.ghost()
.small()
.cursor_pointer()
.compact()
.tab_stop(false)
.label(SharedString::new(name)),
)
.p_0()
.overlay_closable(self.popover_overlay)
.open(self.popover_open)
.on_open_change(cx.listener(move |this, open, window, cx| {
this.toggle(*open, window, cx);
}))
.text_sm()
.h(px(200.))
.w(px(360.))
.when_some(list, |this, list| this.child(List::new(&list)))
.child(Divider::horizontal())
.child(
div().flex().p_2().items_center().justify_end().child(
Button::new("open")
.ghost()
.small()
.compact()
.cursor_pointer()
.tab_stop(false)
.gap_2()
.child(SharedString::new("Open Project Folder"))
.child(Kbd::new(Keystroke::parse("cmd-shift-o").unwrap()).appearance(false))
.on_click(cx.listener(|this, _, window, cx| {
this.open_project_folder(window, cx);
})),
),
)
.anchor(Corner::TopLeft)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels