How to get -moz-user-focus: ignore to work?

懵懂的女人 提交于 2019-12-13 03:38:35

问题


My understanding is that when using -moz-user-focus: ignore (see doc) on an element, Firefox should skip that element when tabbing. However, try:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    </head>
    <body>
        <form action="/">
            <input type="text" value="First">
            <input type="text" value="Second" style="-moz-user-focus: ignore">
            <input type="text" value="Third">
        </form>
    </body>
</html>
  1. Hit tab a first time: you're on the first text field.
  2. Hit tab a second time: you're on the second text field, despite the -moz-user-focus: ignore. Am I missing something here?

回答1:


It seems there is a bug covering this in the Mozilla bug base. Until this bug is fixed, we can use tabindex="-1" instead of CSS as a workaround.



来源:https://stackoverflow.com/questions/3671169/how-to-get-moz-user-focus-ignore-to-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!