Repository navigation
Text: typing goes on after Tab in a text box (#78) - #139
Open
alexanderalber wants to merge 1 commit into
Open
alexanderalber wants to merge 1 commit into
alexanderalber wants to merge 1 commit into
Conversation
The engine handled Tab (a tab character, or a list level at the start of a paragraph), but egui also treated it as focus navigation: with no widget focused it focused the first ribbon widget, and since the slide only takes keys while nothing is focused, every key after Tab was lost. When the slide has the keyboard, the keyboard handler now cancels that focus move. This also covers the "can't type after indenting" part of storytold#93. generated with Claude Code
This branch has not been deployed
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 #78. Also covers the "when you indent to have a sub-element, you are unable to type" part of #93 (the Enter/list-continuation part of #93 is not addressed here).
Cause: the engine already handled Tab correctly (
Session::key: a tab character, or Increase List Level at the start of a paragraph). But egui also read Tab as focus navigation. With no widget focused, it gave focus to the first focusable widget (a ribbon control).SlideApp::keyboardonly routes keys to the slide while no egui widget has focus, so every key after the Tab went nowhere. The same happened to Tab/Shift+Tab cycling through shapes when not editing.Fix: when the slide has the keyboard and handles a Tab,
keyboard()(which runs before the widgets are laid out) cancels egui's pending focus move viamove_focus(FocusDirection::None). Tab navigation inside dialogs and focused text fields is unchanged, becausekeyboard()returns early in those cases.crates/ui-egui/src/lib.rs: the fix, plustyping_goes_on_after_tab_in_a_text_box(egui_kittest). It types, presses Tab, types and deletes, then Enter + Tab (indent) and types again. The test fails without the fix ("ab\t"instead of"ab\tc").docs/gaps.md,docs/ui-parity.md: removed the Tabbing key in a text box does not allow you to continue adding text to that box #78 gap and updated the row, with revision history.cargo xtask cipasses locally.🤖 Generated with Claude Code