There is an iPhone and you need to catch the change event on hidden input. When it opens on the PC, it works, I see the text changed . In case I open it on the iPhone, it does not work properly, I just see the open dialog .
A simple jsfiddle demonstrates this .
<input type=file style="display:none" id=file> <button type=button id=but>open</button> <div id=out> </div>
and
$(document).ready(function(){ $('#but').on('click touchend', function(){ $('#out').text('open dialog'); $('#file').click(); }); $('#file').on('change', function(evt) { $('#out').text('changed'); }); });
What about him? Is this a new iOS bug? Afaik, he worked just a month ago.
I tried replacing hidden with opacity:0 , it works for simple jsfiddle, but does not work in a complex project with a hidden sidebar. The question is as follows. How to make a simple fix and what has recently changed (some Safari update?), What caused the change in hidden input behavior?
javascript jquery ios iphone
shukshin.ivan
source share