Clicked chrome releases the keyboard back to the editor - #81
Merged
Conversation
Clicking a button or checkbox left browser focus on the control: Space re-toggled the layer checkbox instead of panning, arrows walked the panel, and every editor shortcut died on the useKeyboard input guard until the canvas was clicked. Add an app-wide guard that blurs click-activated chrome (buttons, links, checkboxes, radios) after the click lands. Controls where post-click typing is the point (text fields, selects, sliders, color wells) keep focus, and keyboard-driven focus is untouched because the guard only reacts to clicks. A handler that deliberately moves focus during the click (the search clear button) wins over the guard.
# Conflicts: # CHANGELOG.md
rebaserHEAD
added a commit
that referenced
this pull request
Jul 28, 2026
Merged main in (PR #81, chrome focus-steal fix) so the branch lints the same tree CI does; the new test file had one `as string` on a value already typed string, which the type-aware lint flags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About
Field report: toggle a layer checkbox, then keybinds stop working. Space toggles the checkbox again, arrows navigate the panel, and tool shortcuts (like the entity editor) go dead until you click the canvas.
This is stock browser behavior: a click moves DOM focus onto the control and leaves it there, and the keyboard hook correctly refuses to fire shortcuts while focus sits in a form control. Webapp behavior, exactly the kind we keep hunting down.
Rather than patch the Layers panel and leave the same trap in every other panel, this adds one app-wide guard: after a click lands on click-activated chrome (buttons, links, checkboxes, radios), focus is released back to the document, so the keyboard belongs to the editor again. Three deliberate carve-outs:
I checked first that nothing relies on blur-to-close: the only onBlur users are the commit-on-blur text fields in Map Properties, which are text inputs and exempt.
Testing
Checklist