我的网页在开放放大器(200%)时自动向后移动

发布于 2025-01-22 06:31:07 字数 464 浏览 3 评论 0原文

我有一个网页,当我单击一个按钮时(同时使用鼠标单击或使用Tab和按下键盘),它将显示一些项目,通常,它可以完美。

但是,如果我 1>开放式Windows放大器为200%, 和
2>将键盘与选项卡一起使用,然后按 为了触发按钮,

项目仍然正确显示, 但是,整个页面会自动在地平线上来回移动,直到我移动mmouse或按任何键为止。

++++++ 我有根本原因: 当我在控制台中输入以下代码

document.addEventListener('focus',
     function()
     { console.log('focused: ', document.activeElement)
     },
     true);

以监视聚焦元素时, 它表明焦点是两个元素之间的切换, 但是,我尝试使用Tabindex = 0或-1设置两个元素, 以及所有4个组合, 但这无效。

I have a web page, when I click one button(by both using mouse click or using keyboard with tab and press), it will show some items, normally, it works perfect.

However, if I
1> open windows magnifier with 200%,
AND
2> use keyboard with tab and press
to trigger the button,

the items still shows correctly,
but the whole page moves back and forth in horizon automatically until I move mmouse or press any key.

++++++
I got the root cause:
As I input the follow code

document.addEventListener('focus',
     function()
     { console.log('focused: ', document.activeElement)
     },
     true);

in console to monitor the focused element,
it shows the focus are switch between two elements,
however, I try to set the two element with tabindex = 0 or -1,
and all the 4 combinations,
but it doesn't work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉南桥 2025-01-29 06:31:07

您是否正在使用放大镜的“停靠”,“全屏”或“镜头”视图?

我猜“全屏”,因为在该模式下,当您通过页面选项卡时,放大镜将尝试将键盘焦点保持在视图中。您可能会遇到一个问题,即您的焦点在两个元素之间移动,这两个元素都不能同时显示在放大镜中。通常,它只会将放大镜移至具有焦点的元素。

我建议您先尝试“停靠”和“镜头”查看,以查看您是否仍然有问题。

Are you using "docked", "full screen", or "lens" view for the magnifier?

enter image description here

I'm guessing "full screen" because in that mode, as you tab through a page, the magnifier will try to keep the keyboard focus within view. You might have an issue where your focus is moving between two elements that both can't be displayed in the magnifier at the same time. Usually it will just move the magnifier to the element that has focus.

I'd suggest trying "Docked" and "Lens" view first to see if you still have an issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文