gpui-component/crates/ui
Andreas Johansson b6bf2d8c5e
menu: Use defer to avoid race conditions with click listeners (#1651)
When using `.context_menu` on a parent element, the
`window.on_mouse_event` would fire before, for example, the tables
`on_mouse_down` so it'd be like this:
1. First right click = no context menu, right_clicked_row is set
2. Second right click = context menu, but with the row from the first
click

Before: (Look at `Selected row`)  


https://github.com/user-attachments/assets/5eb89a00-f1ce-4423-b8d7-3ec61b848b83

After:


https://github.com/user-attachments/assets/10033ca4-4c2c-47b5-ace5-6ba745fcfee5

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-21 02:27:21 +00:00
..
locales setting: Add Settings component. (#1632) 2025-11-20 13:51:44 +00:00
src menu: Use defer to avoid race conditions with click listeners (#1651) 2025-11-21 02:27:21 +00:00
tests/fixtures dialog: Rename Modal to Dialog. (#1538) 2025-11-07 17:25:55 +08:00
Cargo.toml Bump v0.4.1 2025-11-20 17:26:14 +08:00
LICENSE-APACHE chore: Hard link crates/ui/LICENSE-APACHE. 2025-11-04 17:54:14 +08:00