Track focus shenanigans with context menu
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
970c7b8987
commit
79e6dedb7a
3 changed files with 15 additions and 32 deletions
|
@ -239,7 +239,6 @@ impl Render for ContextMenu {
|
|||
action,
|
||||
} => {
|
||||
let handler = handler.clone();
|
||||
let dismiss = cx.listener(|_, _, cx| cx.emit(DismissEvent));
|
||||
|
||||
let label_element = if let Some(icon) = icon {
|
||||
h_stack()
|
||||
|
@ -263,10 +262,7 @@ impl Render for ContextMenu {
|
|||
})),
|
||||
)
|
||||
.selected(Some(ix) == self.selected_index)
|
||||
.on_click(move |event, cx| {
|
||||
handler(cx);
|
||||
dismiss(event, cx)
|
||||
})
|
||||
.on_click(move |_, cx| handler(cx))
|
||||
.into_any_element()
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue