1

When uploading a file in Safari the :hover state freezes until the mouse is moved again, see this example:

input:hover{
  background-color: red;
}
How to reproduce: open this is Safari, click on the input, choose a file and don't move the mouse. The hove state does not update!<br><br>

<input type="file">

Is there any way I can force a repaint/update of the cursor position? I have tried the following solutions, which do not work in this case:

Does anyone have a different Javascript or CSS solution, that tells the browser to update the cursor position after the change event is fired? Thanks in advance.

Ood
  • 1,445
  • 4
  • 23
  • 43
  • I think I'm not understanding properly. In Edge/Chrome for example if I hover on the input I get the red, as expected. Then if I don't move the mouse but select the file with the enter key I still have the red. Isn't this what you expect? It's still hovered. Can you explain a bit more what is the problem? – A Haworth Nov 27 '22 at 09:40
  • @AHaworth In Safari there seems to be a bug. You don’t have to use the enter key to select, just click on it, choose a file and don’t move to mouse afterwards. The background remains red (even if the mouse is no longer hovering!) until the mouse is moved again. I am looking for a way to repaint the screen to circumvent this bug. – Ood Nov 27 '22 at 12:17

0 Answers0