In my application, we use this pattern a lot:
<select name="select" onfocus=this.select; onClick=this.focus();>
<option value="value1" selected>Value 1</option>
<option value="value2">Value 2</option>
</select>
<script>
document.onmousedown = new Function("return false");
</script>
The line document.onmousedown = new Function("return false");
is aimed to prevent text selection in the page. Unfortunalty, it also blocks the propagation of the mousedown event to the select element. The workarround we use is the callbacks onfocus=this.select; onClick=this.focus();
.
My problem is that it doesn't work with Firefox 40 : clicking on the select box does nothing. (works fine with 39)
I can remove the line document.onmousedown = new Function("return false");
to repair the select box but it would allow text selection in the page.
My question is : what are my options to have both the working select box and the not working text selection with Firefox 40 ?