开发者

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

开发者 https://www.devze.com 2023-01-15 14:29 出处:网络
My understanding is that when using -mo开发者_如何学JAVAz-user-focus: ignore (see doc) on an element, Firefox should skip that element when tabbing. However, try:

My understanding is that when using -mo开发者_如何学JAVAz-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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消