mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-30 18:27:00 +01:00
text editor trial: Shift+Tab leaves the canvas editor for a second editor beside it
Tab order wraps, so with the editor as the window's only stop Shift+Tab would bring the focus back to it whatever the editor does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34ee5771e5
commit
f4e89d15d5
1 file changed
+3
-2
@@ -661,11 +661,12 @@ fn field_modes_end_on_enter_tab_and_shift_tab_but_not_while_composing() {
|
||||
}
|
||||
|
||||
/// The canvas editor keeps Shift+Tab only for a host with its own Tab: on any other host Shift+Tab moves the focus out
|
||||
/// of the editor and types nothing.
|
||||
/// of the editor and types nothing. A second editor beside it gives the focus somewhere to go: Tab order wraps, so the
|
||||
/// only stop in a window would take the focus back.
|
||||
#[trial]
|
||||
fn shift_tab_leaves_a_canvas_editor_whose_host_has_no_tab_keys() {
|
||||
use craft_ui::testing::access::{focused_key, name};
|
||||
let mut editor = session_on(Host { text: "abc".to_owned(), ..Host::default() }, None, false, EditorMode::Canvas, false);
|
||||
let mut editor = session_on(Host { text: "abc".to_owned(), ..Host::default() }, None, true, EditorMode::Canvas, false);
|
||||
editor.focus();
|
||||
let focused = |editor: &Session| name(editor.fixture.tree(), focused_key(editor.fixture.tree())).map(str::to_owned);
|
||||
assert_eq!(focused(&editor).as_deref(), Some("Text"), "the editor has the focus");
|
||||
|
||||
Reference in new issue
Block a user