Android的WebKit的:绝对定位的元素不尊重的z-index素不、Android、WebKit、index

2023-09-05 05:56:55 作者:Style丶夙愿

讨厌的小虫子,这一个。

Nasty little bug, this one.

如图的Andr​​oid票6721 ,Android浏览器似乎不尊重的z-index时,绝对定位的元素放置在顶部< A> <输入> 标签。 我绝望了任何形式的变通方法。有没有人征服了这个前?

As illustrated in Android ticket 6721, the Android browser seems to not respect z-index when absolutely positioned elements are laid over the top of <a> or <input> tags. I am desperate for any sort of workaround. Has anybody conquered this one before?

在此先感谢!

推荐答案

此问题可能与控制及其作为特殊的浏览器。当看到你的问题(铬),我发现了一个相关的问题是,当你preSS tab键,你仍然可以把重点放在输入元素。你可能不希望这是(无论bleedthrough的)。该解决方案是非常简单,你写你的脚本到禁用属性添加到所有输入/按键/等。被重叠元素。禁用的投入将无法接受焦点(通过键盘或其他方式),以及单击它应该是不可能的。

This problem is probably related to controls and their being special for the browser. While looking at your problem (in chromium) I found a related problem that when you press the tab key you will still be able to focus the input elements. You probably don't want this either (regardless of bleedthrough). The solution is surprisingly simple, you write your script to add the disabled attribute to all input/button/etc. elements that are overlayed. A disabled input will not be able to receive focus (by keyboard or otherwise), and clicking it should be impossible.

因为这也将禁用傻键盘航行它甚至不是一个解决办法,但更好的设计也与预期基于键盘导航。

As this also disables silly keyboard circumnavigation it is not even a workaround, but a better design that also works with keyboard based navigation as expected.