Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Learn More

Unexpected cursor shown inside focused div

  • 3 odpowiedzi
  • 0 osób ma ten problem
  • 14 wyświetleń
  • Ostatnia odpowiedź od Ken

more options

I recently noticed a number of places on websites where a cursor would appear in a place where no keyboard input is accepted. I've narrowed it down to this:

Define a div like this: <div tabIndex="1"></div>

Style it like so: div {

 width: 200px;
 height: 100px;
 border: solid 2px red;

} div:focus {

 background-color: lightblue;

}

Click inside the div. It turns blue to show it has focus, but it also shows a cursor at the top-left.

This does not seem to happen when you use <div tabIndex="1" /> and it also doesn't happen in other browsers.

I recently noticed a number of places on websites where a cursor would appear in a place where no keyboard input is accepted. I've narrowed it down to this: Define a div like this: &lt;div tabIndex="1"&gt;&lt;/div&gt; Style it like so: div { width: 200px; height: 100px; border: solid 2px red; } div:focus { background-color: lightblue; } Click inside the div. It turns blue to show it has focus, but it also shows a cursor at the top-left. This does not seem to happen when you use &lt;div tabIndex="1" /&gt; and it also doesn't happen in other browsers.
Załączone zrzuty ekranu

Zmodyfikowany przez Ken w dniu

Wybrane rozwiązanie

You may have switched on caret browsing. You can toggle caret browsing off/on by pressing F7 (Mac: fn + F7).

  • Settings -> General -> Browsing
    remove checkmark: [ ] "Always use the cursor keys to navigate within pages"

Note that this is a Firefox accessibility feature.

Przeczytaj tę odpowiedź w całym kontekście 👍 0

Wszystkie odpowiedzi (3)

more options

I discovered it doesn't even need to support focus. Just the click on a basic div shows the same.

<html>

 <head>
   <style>
     div {
       width: 200px;
       height: 100px;
       border: solid 2px red;
       padding: 10px;
     }
   </style>
   <title>Unexpected cursor in clicked div</title>
 </head>
 <body>
   <h1>Unexpected cursor in clicked div</h1>
   <ul>
     <li>Click inside the rectangle below.</li>
     <li>
       Expected: Nothing should change.
     </li>
     <li>Actual: A cursor appears at the top-left of the box.</li>
   </ul>
   <div></div>
 </body>

</html>

Zmodyfikowany przez Ken w dniu

Pomocne?

more options

Wybrane rozwiązanie

You may have switched on caret browsing. You can toggle caret browsing off/on by pressing F7 (Mac: fn + F7).

  • Settings -> General -> Browsing
    remove checkmark: [ ] "Always use the cursor keys to navigate within pages"

Note that this is a Firefox accessibility feature.

Pomocne?

more options

Ah, there you go. That's exactly what it was. I'm not sure how I had turned that on.

Thanks for the speedy explanation!

Pomocne?

Zadaj pytanie

Aby odpowiadać na posty, musisz zalogować się na swoje konto. Zadaj pytanie, jeśli nie masz jeszcze konta.