Closed fkhadra closed 1 year ago
Thanks for opening this! I think we can add a new Preferences
key under the Mac settings for these kinds of options and plumb them into the WebKit preferences.
We'll need to add a tristate Boolean for this kind of thing to detect the difference between "unset" and false.
Thank you. I'll prepare a PR for that 👍🏽
Awesome! I created https://GitHub.com/leaanthony/u for tristate scalars. Using u.Bool
will mean we can tell whether to just leave the default value or not.
Hey @leaanthony, when I try to install u
I'm getting the following error
go: github.com/leaanthony/u@v1.0.0: parsing go.mod:
module declares its path as: u
but was required as: github.com/leaanthony/u
I believe the go.mod needs to be updated as follow, can you confirm? If so I can prepare a PR
- module u
+ module github.com/leaanthony/u
thanks!
🤦 yes I need to fix that. Thanks for letting me know.
Fixed 👍
Awesome, thanks for the fix I'll give it a try later.
Regarding the scope, I thought about exposing the following preferences to begin with. The list can be extended later if needed.
When it comes to the implementation
// setting preferences for a wails app
preferences := Preferences{
TabFocusesLinks: u.NewBool(true),
}
// vs
prefrences := Preferences{
TabFocusesLinks: true,
}
CreateWindow
function in WailsContext.m
, all arguments are primitives. Should we do the same when passing the preferences or can we create a struct for that?
// other arguments ignored for clarity
CreateWindow:(bool)tabFocusesLinksEnabled
// or
CreateWindow:(Preferences)preferences
// we need to make sure that for each field of the struct the type for C is correct ?
Thanks in advance!
Yes, expose the tri-state vars in the options. For objective C I'd use a struct of C bool pointers to manage that with null checks in the preferences set up.
Thanks a lot!
Is your feature request related to a problem? Please describe.
"By default, Apple computers have an operating system (OS) level setting that limits the Tab key to "Text boxes and lists only". This can be confusing, if not frustrating, for those unaware of this setting and expect keyboard focus to be similar to navigating on a Windows machine." For example, links are not focusable by default when using the keyboard. See https://www.a11yproject.com/posts/macos-browser-keyboard-navigation/ for full details.
Describe the solution you'd like
Webkit exposes a setting to make links focusable using the keyboard under
WKPrefences.tabFocusesLinks
. This is documented here.I see 2 possible solutions:
true
, this way the application behaviour is more consistent across different OS when it comes to keyboard navigation.mac.Options.TabFocusesLinks: boolean
.Locally, I've tried the first solution given it was the fastest to test and it works. I've added the line below.
I would be happy to contribute if needed.
Describe alternatives you've considered
Currently, I'm handling the tab navigation with javascript. I create a tree walker with all focusable element and use it to navigate across focusable nodes.
Additional context
No response