fix(webkit): enable Tab keyboard navigation on macOS - #42180
fix(webkit): enable Tab keyboard navigation on macOS#42180Som Samantray (SomSamantray) wants to merge 3 commits into
Conversation
WebKit on macOS reads the "AppleKeyboardUIMode" preference to decide whether Tab traverses all focusable elements, making Tab behavior depend on the OS-level "Keyboard navigation" setting. Pass it as an NSUserDefaults launch argument so Tab always traverses buttons and inputs regardless of the host setting. Fixes: microsoft#41808
With full keyboard access forced on macOS WebKit, Tab now moves between buttons and inputs. Links remain Option+Tab-only, matching macOS full keyboard access semantics. References: microsoft#41808
The webkit-wsl channel cannot launch on darwin, so the guard never fires; the sibling darwin block for proxy args already omits it. References: microsoft#41808
|
Note: this fix changes macOS-only WebKit behavior. Could the |
This PR is blocked on the Microsoft Contributor License Agreement. Only the account owner can sign it: reply |
|
@microsoft-github-policy-service agree |
| // starting with '--' as an initial URL, and 'about:blank' must remain the last one. | ||
| // See https://github.com/microsoft/playwright/issues/41808. | ||
| if (process.platform === 'darwin') | ||
| webkitArguments.push('-AppleKeyboardUIMode', '2'); |
There was a problem hiding this comment.
This is going to break everyone with the macOS defaults in place (0). But similarly, passing 0 would break teams that aligned on opting into 2.
Summary
-AppleKeyboardUIMode 2as an NSUserDefaults argument when launching WebKit on macOS, so full keyboard access is always on and Tab traverses all controls regardless of the host setting.Fixes #41808
Session-settled decisions carried from planning: force
AppleKeyboardUIMode=2for WebKit on macOS via launch args (user-approved, over documenting the workaround).