-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popup menu and pickers doesn't capture the input used to close it #5189
Comments
This is by design (though arguably not good design). The thinking (within egui) is: pressing escape should escape everything. Otherwise what it escapes would depend on the order of which the UI is laid out, which is not obvious to a user ("why did A close instead of B?"). |
What is the "correct" way to opt-out of a popup menu then?
Perhaps naively, I'm expecting popup-menu/picker to be modal, so (1) they may not have sibling areas—only parent, over which they have precedence and (2) they may have zero or one "child" modal (e.g. a sub-menu), which would have precedence. In this model, it feels quite natural in how keystroke would be captured. Surely I'm missing dozen of edge cases and assorted implementation trickeries here, though.
My mental model doesn't conform to that. If have a stack of "modal things" open, I'm expecting to get out of it by hitting escape as many times as the number of modal things that are opened. Related:
|
#7548) ### What This PR attempt to make the "deselect-on-ESC" less aggressive and avoid triggering it when the ESC keystroke was used to close some other UI element. Work around for: - emilk/egui#5189 #### Supported - any popup menu (including color picker) - context menu - modals #### TODO - rerun menu (haven't found an easy way yet) #### Not supported - tooltip (on purpose, these disappear by themselves) ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7548?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7548?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/7548) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
Switching all
|
Debatable :) Personally I'd rather have to ESC twice when I want full out than having no way to opt-out of a single level of sub-menu. Counter argument: macOS closes all layers of menu on ESC. |
In my popups / modals I show a second area right below the popup area that covers the entire screen and "catches" any clicks outside of the popup, which seems to work really well. I also use this to slightly darken everything in the background but that is of course optional. |
I'm not sure if this is tracking the same issue, but in my hex editor, I have this color picker nested in a menu, and it would be nice if it didn't close when I interact with it. |
One can close popup menus and, e.g., the colour picker by clicking outside of it or hitting escape. Unfortunately, these inputs are not captured and thus potentially have an unwanted secondary effect.
In the case of rerun, escape will have the effect of deselecting whatever is currently selected, and the click will be processed by whatever happens to be under the mouse cursor (often, the view, which again leads to deselection).
color_picker.mp4
The text was updated successfully, but these errors were encountered: