Ticket #8445 (closed bug: invalid)

Opened 2 years ago

Last modified 21 months ago

jQuery datepicker doesn't work properly due to the presence of a text input

Reported by: Cupidvogel Owned by: Cupidvogel
Priority: minor Milestone: 1.11.0
Component: ui.datepicker Version: 1.8.21
Keywords: Cc:
Blocking: Blocked by:

Description

I am using the following code to select a date range using 2 inline datepickers. There are two date fields (div, with class dateheader). When a date is selected, that datepicker slides up. Basically when the date div is clicked, first it is checked whether the corresponding datepicker is already viewable (through the fromclicked and toclicked variables), if present, then slide it up, else slide it down, changing the corresponding clicked attribute accordingly, and before doing either, sliding the other datepicker up and setting its corresponding clicked attribute to 0. Now there is a text input at the bottom of the code. When it is excluded, the code works fine, as expected. However if it is included, the code breaks, i.e if you click one date div, then select a date from the datepicker, it will slide up correctly. Then if you click the other date div, the datepicker will slide down alright, but selecting a date won't slide it up. I am at my wit's end. Where is the bug? The complete code is at  http://jsfiddle.net/Cupidvogel/2ppYb/ (I couldn't include the UI-CSS files like the UI darkness theme file and related images, but even the unstyled version is enough!).

Change History

comment:1 follow-up: ↓ 2 Changed 2 years ago by scott.gonzalez

  • Owner set to Cupidvogel
  • Status changed from new to pending

Can you try again to explain the problem? Please do not explain the code. Explain the use case, steps to reproduce, and expected and actual results.

comment:2 in reply to: ↑ 1 Changed 2 years ago by Cupidvogel

  • Status changed from pending to new

Replying to scott.gonzalez:

Can you try again to explain the problem? Please do not explain the code. Explain the use case, steps to reproduce, and expected and actual results.

When you click on the first date div, the datepicker slides down, you select a date, it slides up and the div displays the selected date. Now you click the second date div, the datepicker slides down, you select a date, but the datepicker doesn't slide up. This point onwards, the slide on either div stops working. But the date selection constraints hold, since both the divs will now be showing, you can see that they work, if you choose date in one, the other gets modified to maintain the relation that the second date can't be less than the first date. But the sliding stops. If you comment out the text input, it doesn't happen, and everything works fine.

comment:3 follow-up: ↓ 4 Changed 2 years ago by scott.gonzalez

  • Status changed from new to pending

That example is still fairly complicated and the bug originates in your show/hide logic. Please reduce this further or ask for help on the forums or StackOverflow.

comment:4 in reply to: ↑ 3 Changed 2 years ago by Cupidvogel

  • Status changed from pending to new

Replying to scott.gonzalez:

That example is still fairly complicated and the bug originates in your show/hide logic. Please reduce this further or ask for help on the forums or StackOverflow.

The bug lies in the show/hide part, so that has to be there! The code works fine if you don't include the text input, but if you do, all sorts of problems occur, like I said. That reminds one of some probable class/id clash, but check it out, the text input has no class or id mentioned, just the mere presence of it does the trick. That sure sounds like a bug.

comment:5 Changed 2 years ago by Cupidvogel

Further updation, the error persists only with text or password input, if you change the input type to radio or checkbox, it works fine. Console shows an error statement a is undefined, and points out to the first line of the datepicker js part in the minified UI file.

comment:6 Changed 22 months ago by scott.gonzalez

  • Milestone changed from 1.9.0 to 1.11.0

comment:7 Changed 22 months ago by mikesherov

  • Status changed from new to pending

I need some more information to properly debug this. Can you reduce this test case down further and provide a new fiddle showing the problem with as minimal of your own code as possible? Also, please use the non minified version of jQuery UI so you can provide a useful error message. Thanks again!

comment:8 Changed 21 months ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

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.