Repository navigation
fix(test): include every press handler in keyboard focus stops - #571
Conversation
d5a2687 to
ee923d7
Compare
|
Reviewed. Focus stops and Return/Space activation now take every press handler, matching what the native backends already do, and pointer delivery is unchanged. The new test fails with main's steps.go in all five environments. Verified with |
ee923d7 to
19ff100
Compare
19ff100 to
193bd38
Compare
193bd38 to
0f5b573
Compare
The headless Return and Space handler still used the narrow pressable check, so a view whose only press handler is OnPressUp took the focus through Tab but ignored the keys, while macOS, Windows, Linux and the web send it its up event. Use the full press mask there and in focusKeyUse, and document the stops in the Chinese testing guide too.
0f5b573 to
b52b43f
Compare
|
Reviewed. Rebased onto current main (861c49d, two Linux accessibility commits, no overlap); head is now b52b43f. What I checked:
Runs (Linux build host): Not run: a macOS GUI-target run, because the shared macOS desktop was busy with another job throughout. The PR changes only the headless model; on a target, keys go through native input, which this PR does not touch. CI on b52b43f: Build and vet, test, windows, android, Gallery (web), CodeQL and the repository checks passed. Build and vet (Apple), apple, apple-simulator and Gallery (macos) were still queued for macOS runners after about 45 minutes. |
Summary
Fixes #520.
Headless Tab, Shift+Tab and
App.Focusnow include views whose only press handler isOnLongPressorOnPressUp. Focus navigation uses the driver's complete press-handler mask, matching native focus stops. Return and Space on such a focused view now send the down, up and press events it handles, as macOS, Windows, Linux and the web do: anOnPressUp-only view gets its up event, and anOnLongPress-only view takes the key without an event. Pointer press delivery keeps its existing behavior.Targets
nsgotestfocus and key model.Native backends already use
driver.FocusStopandEventMask.Pressablefor focus and Return/Space, and need no change.Screenshots
None: test keyboard navigation.
Verification
TestFocusIncludesEveryPressHandlerfails on the original code for both handlers in macOS, Windows, Linux, Web and Apple TV environments (Tab skips the view in both directions,Focuscannot find it), and its Return/Space check fails without the key fix (own 0 (want 1)forOnPressUp).go build ./..., vets for windows, linux, android/arm64 and js/wasm,go tool nsgo check -target all: passed.go tool nsgo test ./nsgotest: 79 passed, 1 skipped (after rebasing onto main, beside main'sTestTabSkipsStyleOnlyGroupsAndActiveViews).go tool nsgo test -run 'Layer|Skills|Doc' .: 35 passed.go tool nsgo test -target webof the new test, and a throwaway app-level probe on the real web target (Tab, Shift+Tab,Focusand Return onOnPressUp-only andOnLongPress-only views): passed.Checklist