Skip to main content

Search and Top Navigation

#9035 closed feature (invalid)

Opened January 31, 2013 10:47AM UTC

Closed February 15, 2013 09:02AM UTC

Prevent datepicker from putting focus on input control

Reported by: leszeg Owned by: leszeg
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:
Description

I'm using latest jquery ui library, but couldn't find a way to stop datepicker from putting focus on input element when it opens or when you change month/year. As a workaround I removed the code below, but this is obviously not the way to go. Could you add an additional setting to datepicker so that we can decide whether focus should be put on the input element?

This is the code that would need to be parameterized:

if (inst.input.is(":visible") && !inst.input.is(":disabled")) {

inst.input.focus();

}

#6694 - don't focus the input if it's already focused

this breaks the change event in IE

if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&

inst.input.is(":visible") && !inst.input.is(":disabled") && inst.input[0] !== document.activeElement) {

inst.input.focus();

}

Attachments (0)
Change History (2)

Changed January 31, 2013 01:49PM UTC by scottgonzalez comment:1

owner: → leszeg
status: newpending

Why are you trying to do this? If you don't want focus on an input, you should probably be using the inline datepicker.

Changed February 15, 2013 09:02AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!