Closed ilyatitovich closed 3 months ago
Pull request auto-reviewer
Since you changed core/
:
Updated handleEscapeKey()
function.
addEventListener
that allow us to stopping propagation early in the event flow.fast
or slow
we stop propagation for prevent keyux jump, because for add
and categories
routes is different flow and we need jump back to list + close panel, but for slow
and fast
routes we need just close panel.I changed the conditions for stopping event propagation:
role
checking - this allows us to avoid unexpected jumps to the side menu if the user clicks on a list item with the mouse and then presses Escape
. Now, in this case, the focus will move to the clicked list item.tagName
checking to prevent jumping back if the user clicks on a list item, then clicks somewhere else on the screen, and then presses Escape
to close the side panel.Test: video
Works amazing. Thanks for helping me polish this.
Hope it helps you to go deeper into keyboard UX world (feel free to ask questions about that role
s)
Yes, I learned a lot :D
Fixes #197
I would like to discuss it.
Back
button for desktop view. The button is wide. Should it be square?Escape
key handler. It’s strict withactiveElement
checking so, if I right understand keyux jump only working if current element is no<body>
. Now I don't see any conflict.secondStep
tobackRoute
. Since we have all logic for creatingbackRoute
, maybe it’s not necessary to usetwo-steps.ts
and we can delete it?Checklist
pnpm test
.scripts/
, add a comment with a description.README.md
.README.md
.core/
. What code will also be useful on other platforms?pnpm size
and check the difference in the JS bundle size. Is it relevant to the changes? Change the limit inweb/.size-limit.json
if necessary.