jQuery UI: modal dialog focus bug? -


i trying create modal dialog box has vertical scroll content overflows. demo purposes, dialog box contains anchor , bunch of divs (to overflow). here code:

the html

<body>   <div id="dialog">     <a href="javascript:void(null);">blah blah blah</a>     <div>some content make dialog scroll appear</div>     <div>some content make dialog scroll appear</div>     <div>some content make dialog scroll appear</div>     <div>some content make dialog scroll appear</div>     <div>some content make dialog scroll appear</div>     <div>some content make dialog scroll appear</div>   </div> </body> 

the jquery

$(document).ready(function () {   $('#dialog').dialog({     position: 'center',     height: 300,     width: 200,     modal: true   }); }); 

the demo: js bin

to reproduce issue:

  1. scroll down bottom of dialog box
  2. lose focus on actual browser window (go window, click desktop, etc.)
  3. hover on dialog box in unfocused browser window
  4. click in dialog box (or minimize/maximize browser window)

the result should dialog box scrolling topmost anchor tag ("blah blah blah"). (this may require several attempts lose focus/click in dialog box) js bin code using jquery ui 1.10.2, happens in .3 well.

i believe issue may similar this question, it's little different because i'm using anchor tags... however, line hasfocus.eq(0).focus(); culprit. when part executes me, has anchor tag first element in hasfocus array. either way, default behavior dialog box should not scrolling top... should stay is!

now, interesting part once take away modal: true, issue no longer there... i'm not sure if bug or if it's "feature." have thoughts?

also, i've tested in firefox (multiple versions , safe mode) , ie8.

according bug report, has been fixed , in jquery ui 1.11.0.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -