Skip to main content

Search and Top Navigation

#9714 closed bug (notabug)

Opened December 17, 2013 09:22PM UTC

Closed December 17, 2013 09:52PM UTC

Last modified December 17, 2013 09:55PM UTC

Infinite focus/blur loop when clicking on auto selectable input which is above a modal

Reported by: Petah Owned by: Petah
Priority: minor Milestone: none
Component: ui.dialog Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

I have a case where I have an input that sits on top of everything on a page.

The input has a script that auto selects all the text in it when it is focused.

However when I open a jQuery UI dialog the browser is put into an infinite focus/blur loop.

Anyway to prevent this happening? Or am I doing anything wrong?

HTML:

<div class="dialog">I am a dialog</div>

<input id="input" value="Click on me then look in your console" />

JS:

$('.dialog').dialog({

modal: true

});

var blur = 0;

var focus = 0;

$('#input').on('focus', function() {

focus++;

console.log('focus #'+focus);

var inp = this;

setTimeout(function() {

inp.select();

}, 1);

});

$('#input').on('blur', function() {

blur++;

console.log('blur #'+blur);

});

CSS:

#input {

position: relative;

z-index: 5000;

border: 2px solid red;

width: 400px;

}

http://jsfiddle.net/3XB8L/2/

Attachments (0)
Change History (6)

Changed December 17, 2013 09:33PM UTC by scottgonzalez comment:1

owner: → Petah
status: newpending
Anyway to prevent this happening?

Don't allow the input to be visible while the modal dialog is open. Why do you want this behavior in the first place?

Changed December 17, 2013 09:35PM UTC by Petah comment:2

_comment0: For example a site management sidebar that is supposed to site on top of everything. 1387316173187746
status: pendingnew

For example a site management sidebar that is supposed to sit on top of everything.

Changed December 17, 2013 09:36PM UTC by scottgonzalez comment:3

status: newpending

But why would it be visible while a modal dialog is open?

Changed December 17, 2013 09:42PM UTC by Petah comment:4

status: pendingnew

For a hypothetical example in the phpMyAdmin interface, I want the modal dialog to obscure the main content pane, but allow the user to use the sidebar to navigate between tables, and still have logout buttons etc available for use. Kinda like it worked when phpMyAdmin used a frameset.

Just a FYI this is stemmed from an issue reported to a project I maintain so my usecase is totally hypothetical.

https://github.com/PANmedia/raptor-editor/issues/112

Also note this issue was not present in 1.9.2 according to

http://stackoverflow.com/questions/20643933/jquery-ui-infinite-loop-when-clicking-on-auto-selectable-input-which-is-above-a

Changed December 17, 2013 09:52PM UTC by scottgonzalez comment:5

resolution: → notabug
status: newclosed
I want the modal dialog to obscure the main content pane, but allow the user to use the sidebar to navigate between tables

We don't support partial page modality. But if you really want to do this, see #9087.

Changed December 17, 2013 09:55PM UTC by Petah comment:6

Understandable that you don't support it, but I still think causing an infinite loop is not acceptable.