I'm using select2 inside modal qtips. Select2 (and other skripts) is apending its dropdown to body. Within the dropdown there is a search field, which can't get focus due to the stealFocus(event) function of the modal plugin, which is stealing focus from everything that is not within the current tooltip.
I helped myself (very quick, very dirty) whith this new modal option (which is defaulted to FALSE):
function stealFocus(event){
if(!elem.is(':visible')){ return; }
var target=$(event.target),
tooltip=current.tooltip,
container=target.closest(SELECTOR),
targetOnTop;
//Get back! Oh, get back! Don't you touch my stereo, these are my records!
if(current.options.show.modal.stealNotFrom!==FALSE){
if(target.is(current.options.show.modal.stealNotFrom)){ return; }
}
targetOnTop=container.length<1?FALSE:
parseInt(container[0].style.zIndex,10)>parseInt(tooltip[0].style.zIndex,10);
if(!targetOnTop && target.closest(SELECTOR)[0]!==tooltip[0]){
focusInputs(target);
}
}
I'm not sure if I'm missing an option already build in, because no one seems to have the same problem, while I bet many users use scripts like select2 or selectize, or...
But if there is no option yet, I would suggest (and appreciate) to build in the option, which allows you to specify a selector for items which are excluded from stealFocus.
hi,
I'm using select2 inside modal qtips. Select2 (and other skripts) is apending its dropdown to body. Within the dropdown there is a search field, which can't get focus due to the
stealFocus(event)
function of the modal plugin, which is stealing focus from everything that is not within the current tooltip.I helped myself (very quick, very dirty) whith this new modal option (which is defaulted to FALSE):
I'm not sure if I'm missing an option already build in, because no one seems to have the same problem, while I bet many users use scripts like select2 or selectize, or... But if there is no option yet, I would suggest (and appreciate) to build in the option, which allows you to specify a selector for items which are excluded from stealFocus.