Opened 11 years ago
Last modified 9 years ago
#8121 open bug
Datepicker: Focusing multiple elements at the same time throws an error.
Reported by: | tojocky | Owned by: | tojocky |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.8.17 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hello,
When I upgraded to the latest release 1.8.17 I have an error on submit button on line: https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js#L644
This error is prompt because $.datepicker._curInst is null. This value seems to be nulled by calling $.datepicker._curInst.dpDiv.stop(true, true); method from: https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js#L642
As a temporary solution I found to rewrite the line: https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js#L643 from:
if ( inst && $.datepicker._datepickerShowing ) {
into:
if ( $.datepicker._curInst&&inst && $.datepicker._datepickerShowing ) {
I didn't had time to debug more deep. Maybe this is not the right patch.
I use jQuery 1.7.2.pre where "this" is changed by this line: https://github.com/jquery/jquery/blob/master/src/queue.js#L116
Change History (10)
comment:1 Changed 11 years ago by
Component: | ui.core → ui.datepicker |
---|---|
Owner: | set to tojocky |
Status: | new → pending |
comment:3 Changed 11 years ago by
the download link: http://www.2shared.com/file/V8b3t-KK/jquery_ui_bug.html
comment:4 Changed 11 years ago by
Status: | new → open |
---|---|
Summary: | $.datepicker._curInst have no property input in _showDatepicker method → Datepicker: Focusing multiple elements at the same time throws an error. |
The error comes from focusing multiple datepicker fields in the same event loop. You should file a bug against that validation plugin.
comment:5 Changed 11 years ago by
Sorry, What did you mean by: "You should file a bug against that validation plugin."? My proposed patch work... but I'm not sure this is the correct patch. Awaiting for feedback.
I have no permission to attach any file here.
comment:6 Changed 11 years ago by
I mean that it is never correct to fire a focus events on multiple elements. The validation plugin that you're using is implemented poorly and should be fixed.
comment:7 Changed 11 years ago by
Could you explain more exactly where is the problem? The plugin works as expected focusing multiple elements in one trigger call.
comment:8 Changed 11 years ago by
It's not possible to actually focus multiple elements at the same time. The plugin should work differently.
I'm not saying that there's not a bug in datepicker (that's why the ticket is still open), what I'm saying is that there's also a design bug in the validation plugin you're using.
comment:9 Changed 10 years ago by
Milestone: | 1.9.0 → 1.11.0 |
---|
comment:10 Changed 9 years ago by
Milestone: | 1.11.0 → none |
---|
Please provide a reduced test case showing the problem.