Skip to content

Reach the step's focus from the keyboard in every engine - #112

Merged
pournasserian merged 1 commit into
mainfrom
70-step-focus-check
Nov 28, 2026
Merged

pournasserian merged 1 commit into
mainfrom
70-step-focus-check

Conversation

@pournasserian

Copy link
Copy Markdown
Member

Follow-up to #70 (PR #107). This fixes the test AStepButtonShowsHoverPressAndFocus, which fails in Firefox and WebKit in nightly 46168239715 (NumberInputTests.cs:191, :focus-visible false).

Cause: input modality in the test, not missing visible focus

A probe on unchanged main 533540c, run in local Playwright Chromium 156.0.8078.4, Firefox 157.0 and WebKit 27.2, found:

  • In all three engines, the mouse press in the test has already focused the step, and that focus is not visible. Then:
    • Chromium: a Shift key press switches to keyboard modality and makes the focused step :focus-visible.
    • Firefox and WebKit: a modifier-only key doesn't switch modality, and el.focus() on the element that already has focus does nothing, so :focus-visible stays false.
  • When the keyboard first Tabs to the number input (:focus-visible, the box shows its ring) and script then moves focus to the step, the step is :focus-visible with a solid outline in all three engines.

So the CSS draws the ring correctly. Only the test's way of reaching keyboard focus depended on Chromium's heuristic.

Change, test only

The test Tabs, with the real keyboard, to the number input that the step belongs to. It asserts that the input is :focus-visible and that its box draws the ring. Script then moves focus to the step, which is checked for focus, :focus-visible and a solid outline.

  • The hover and pressed assertions are unchanged.
  • The step keeps tabindex="-1".
  • No engine checks, no skips, no CSS or JavaScript changes.

Evidence (local Windows arm64)

  • RED on main's test, $env:FLUENTCMS_BROWSER=<engine>; dotnet test --project tests/FluentCMS.Components.Browser --no-build --filter-method '*AStepButtonShowsHoverPressAndFocus':
    • chromium: exit 0, 3/3 passed;
    • firefox: exit 2, 3/3 failed;
    • webkit: exit 2, 3/3 failed.
  • GREEN, same command with --minimum-expected-tests 3: chromium, firefox and webkit each exit 0, 3/3 passed.
  • Chromium, whole *NumberInputTests class: exit 0, 19/19 passed.
  • The local WebKit is Playwright's Windows build, not Linux and not Safari. The hosted Linux matrix is still to run.

Refs #70

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review of 5dc9dd4: the only changed file is the #70 keyboard/focus test. Confirmed the red three-row Firefox/WebKit results, observed keyboard modality evidence on main, and green three-mode checks on all three Playwright engines locally. Real Tab reaches the number input and its ring before focus moves to the step. No skip, longer timeout, production markup/JS/CSS change, or removal of pressed/hover checks. Accept this focused fix conditional on full exact-head PR CI. The hosted cross-engine run on combined #70/#73/#74 will still be needed.

@pournasserian
pournasserian merged commit 80c4ad5 into main Nov 28, 2026
4 checks passed
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.

1 participant