<label for="input">Label</label><input type="file" id="input"/>
In Firefox 7 it is not possible to trigger the open file dialog by clicking on the label.
This SO question is very similar but that's green checked with it's a bug in FF. I'm looking for a workaround.
Any ideas?
you can dispatch the event from any event to the type=file input if you want make the input display:none and visibility:hidden, and then dispatch the event from, say, the click|touch of an image ...
A work around when you don't need/want to have the input box (like image upload) is to use
opacity: 0
in the element and usepointer-events: none;
in the label. The solution is really design specific but maybe should work for someone who comes to this. (until now the bug doesn't been fixed)http://codepen.io/octavioamu/pen/ByOQBE
Reverse the order of the label and input elements. iow, put the label element after the input element.