I'm stopping a mousedown
event when my users press on a custom dropdown list. This is to avoid the default text-highlighting behaviour of the browser while the user is effectively dragging the mouse.
I'm doing this with a jQuery event.preventDefault()
call in the handler function and returning false.
This has the desired effect, except that in Chrome it also prevents CSS :hover
states to work while the mouse is still pressed.
Firefox doesn't suffer the same problem. The text highlighting is cancelled, and the :hover states continue to work as the user rolls over items with the mouse still pressed.
Is there a method that will work in Chrome too?
I could add further mouseover
handlers to add custom classes, but I'd prefer a more graceful solution so I can use the :hover pseudo classes in my CSS.