开发者

How not to Allow Cursor go into Input Automatically?

开发者 https://www.devze.com 2023-03-17 06:04 出处:网络
I have form with input\'s. When it\'s opened (via jQuery UI: Dialog)... cursor (that think that blinks after your text as you type) automatically jumps into first 开发者_开发问答input! It ruins my pla

I have form with input's. When it's opened (via jQuery UI: Dialog)... cursor (that think that blinks after your text as you type) automatically jumps into first 开发者_开发问答input! It ruins my placeholder's text and I'm looking for way to disallow cursor automatically focus on input or set another input as default one for focusing-in.


The offending code is in the open() function of the UI dialog:

    $(self.element.find(':tabbable').get().concat(
        uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat(
            uiDialog.get()))).eq(0).focus();

It automatically gives focus to the first tabbable element in the dialog. You can make your input untabbable by setting the property tabindex="-1" on the <input>.

Hope that helps

0

精彩评论

暂无评论...
验证码 换一张
取 消