bestprotop / jquery-multifile-plugin

Automatically exported from code.google.com/p/jquery-multifile-plugin
0 stars 0 forks source link

Chrome scroll page to last focused element on change focus #146

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I use your plugin in jQuery Dialog. Only when my page have scroll position on Y 
is not 0, After first file added, when i click on new file input, my page 
scroll top.
Trouble in sthis line:
// Hide this element (NB: display:none is evil!)
//$(this).css({ position: 'absolute', top: '-3000px' });

Scroll move to last focused element. this line not help:
// Lose focus to stop IE7 firing onchange again
$(this).blur();

If hide element whiththis code, all is ok:
$(this).hide();//change position led to focus bug in Chrome

Original issue reported on code.google.com by d.tarase...@gmail.com on 2 Apr 2012 at 2:12

GoogleCodeExporter commented 9 years ago
I see why IE7 is scrolling up, but I'm not sure using .hide() is the solution.

I will have to look into this, but I think there is a security feature in some 
browsers that if you hide the file element it doesn't get submitted...

Original comment by diego.a...@gmail.com on 2 Apr 2012 at 2:24

GoogleCodeExporter commented 9 years ago
Can you provide a link to a page where we can see the problem?

Original comment by diego.a...@gmail.com on 2 Apr 2012 at 2:25

GoogleCodeExporter commented 9 years ago
I am sorry to trouble you. I have finded trouble. We bind this event for all 
dialogs  in depths of our scripts:
var dialogOptions = new Object();
dialogOptions.focus = function (event, ui) {
   $(event.target).find(":input:visible:first").focus();
};
$.extend($.ui.dialog.prototype.options, dialogOptions);

Certanly, hiding by position led to this trouble.
Thank you, for your job:-)

PS
I have check jQuery hide method in Chrome,FireFox,IE9, IE9 in IE7 mode, IE9 in 
IE8 mode. All work success on jQuery 1.51.

Original comment by d.tarase...@gmail.com on 3 Apr 2012 at 12:17