Skip to content

Text: typing goes on after Tab in a text box (#78) - #139

Open
alexanderalber wants to merge 1 commit into
storytold:mainfrom
alexanderalber:issue-78-tab-in-text
Open

alexanderalber wants to merge 1 commit into
storytold:mainfrom
alexanderalber:issue-78-tab-in-text

Conversation

@alexanderalber

Copy link
Copy Markdown
Contributor

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::keyboard only 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 via move_focus(FocusDirection::None). Tab navigation inside dialogs and focused text fields is unchanged, because keyboard() returns early in those cases.

cargo xtask ci passes locally.

🤖 Generated with Claude Code

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tabbing key in a text box does not allow you to continue adding text to that box

1 participant