Opened 6 years ago

Closed 6 years ago

#9035 closed feature (invalid)

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();

}

Change History (2)

comment:1 Changed 6 years ago by Scott González

Owner: set to 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.

comment:2 Changed 6 years ago by trac-o-bot

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!

Note: See TracTickets for help on using tickets.