How to re-enable text selection in an input field

According to MDN , the property -moz-user-select

for an element will be set on all subitems as well. It also states that user selections can be re-enabled on subitems using -moz-user-select:text

.

I can't get this to work with my input elements in firefox, but it does work in Chrome. Any idea on how to fix this?

Example: http://jsfiddle.net/NBNpF/3/ (try adding focus to the input field, it only works in Chrome, not Firefox). I am using FireFox 18.0.2

+3


source to share


1 answer


I found a solution, I think the key should have been replaced -moz-user-select: none;

with -moz-user-select: -moz-none;

.

so your CSS should look like this:

.unselectable {
  -moz-user-select: -moz-none;
  -webkit-user-select: none;
}

      



I have updated your jsfiddle: http://jsfiddle.net/NBNpF/7/

I hope this help.

+2


source







All Articles