Repository navigation
Focus: preserve Entry across commits when focus stays on the same node - #1316
Merged
Merged
Conversation
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.
Fixes a bug where
sync_requested_focus(crates/rune/src/runtime/input/focus.rs:528-536) promotedEntry::OthertoEntry::Keyson every commit after an in-field arrow / Home / End key (FocusEvent::Navigated) orFocusEvent::WindowReturned, turning onEl::focus_visible_within_ringeven though focus never moved to a new element.Root cause
FocusState::entry(focus_machine.rs:22-25) is meant to stayEntry::Otherwhen an arrow key is pressed inside a field that a pointer click focused (FocusEvent::NavigatedflipsmodalitytoKeyboard, leavingentryuntouched).sync_requested_focuspassedkeyboard = self.kbd.focus.keyboard()(true) intoset_focus(app, next, keyboard)->FocusEvent::Set { path, keyboard }, unconditionally overwritingself.entrywithEntry::Keyseven when focus stayed on the same node without an explicitTx::focus.Fix
keep_entry: booltoFocusEvent::Setandset_focus_entry, set totrueinsync_requested_focuswhenaskeddid not targetnextandnext.as_deref() == self.kbd.focus.path().Tx::focus(key, ring)calls, pointer clicks, Tab, F6, and focus moves to another node still updateEntryas before.Verified with
tools\cargo.ps1 check -p rune --lib --tests(0 errors, 0 new warnings).