Skip to content

Conversation

alebiavati
Copy link

Fix bug that prevents user from clearing date value.

Steps to reproduce:

  1. Go to https://surveyjs.io/form-library/examples/custom-widget-datepicker/jquery
  2. Set date using datepicker
  3. Clear date by deleting input text (Delete key)
  4. Click Complete button to submit form
  5. Click JSON tab to view submitted data

Expected behaviour:

  • Date value is empty

Actual behaviour:

  • Date value did not clear and is set to:
    { "date": "2024-04-09T01:29:51.000Z" }
    
  • JS console error:
    jquery-ui-datepicker.js:120 Uncaught TypeError: Cannot read properties of null (reading 'setHours')
        at r (jquery-ui-datepicker.js:120:13)
        at o.onSelect.o.onSelect (jquery-ui-datepicker.js:101:11)
        at st._selectDate (jquery-ui.min.js:6:101656)
        at st._clearDate (jquery-ui.min.js:6:101467)
        at HTMLInputElement.<anonymous> (jquery-ui-datepicker.js:131:24)
        at HTMLInputElement.dispatch (jquery.min.js:2:43336)
        at y.handle (jquery.min.js:2:41320)
    

Screenshots:
Screenshot 2024-04-08 at 11 26 58 AM
Screenshot 2024-04-08 at 11 27 04 AM
Screenshot 2024-04-08 at 11 29 11 AM

@alebiavati
Copy link
Author

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant