Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(windows): Fix the issue where TAB cannot cycle through focus elements. #1452

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

mzdk100
Copy link
Contributor

@mzdk100 mzdk100 commented Jan 11, 2025

This PR fixes a minor issue, which is discussed here:
Specifically, when a user switches focus within a web element using the keyboard's tab, if they continue to press the tab after switching to the last web element, the focus will jump to the control with the class name WRY_WEBVIEW. At this point, no matter how much they press the tab, they cannot continue switching web elements;
The solution to this problem is to first switch to another application (such as the desktop), and then switch to the dioxus application again. At this point, the system will reset the focus to the web document, and you can continue to use the tab to switch elements, but this requires the user to operate it themselves, and the experience is very poor.

Expected behavior
The control with the class name WRY_WEBVIEW should not be allowed to grab keyboard focus, so that the tab key can be used to cyclically switch web elements.

@mzdk100 mzdk100 requested a review from a team as a code owner January 11, 2025 02:13
Copy link
Contributor

github-actions bot commented Jan 11, 2025

Package Changes Through 46621fc

There are 1 changes which include wry with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
wry 0.48.1 0.49.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@@ -176,6 +176,16 @@ impl InnerWebView {
wparam: WPARAM,
lparam: LPARAM,
) -> LRESULT {
if msg == WM_SETFOCUS {
// Fix https://github.com/DioxusLabs/dioxus/issues/2900
// Get the first child window of the window
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't sound like the correct behavior for multiwebview windows but i don't reallyyy care about that at the moment and it's still better than losing focus completely.

@FabianLars FabianLars merged commit 0185644 into tauri-apps:dev Jan 14, 2025
12 checks passed
@mzdk100
Copy link
Contributor Author

mzdk100 commented Jan 14, 2025

Yes, I will further fix the focus issue with multiwebview windows in the future, thank you.

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.

2 participants