Skip to content

Datepicker: Respect native disabled state in the open calendar - #2424

Open
Xapollon430 wants to merge 1 commit into
jquery:mainfrom
Xapollon430:codex/disabled-open-datepicker
Open

Xapollon430 wants to merge 1 commit into
jquery:mainfrom
Xapollon430:codex/disabled-open-datepicker

Conversation

@Xapollon430

Copy link
Copy Markdown

Fixes #2423.

Problem

An open Datepicker can change its input and run onSelect after the input becomes disabled through the DOM.

Reproduction

Open a Datepicker set to May 5. Set its input’s disabled property to true, then click May 12 in the calendar that is still visible.

Chrome reproduction video

Changes

Check the input’s native disabled state in Datepicker’s existing disabled check. The existing plugin state still handles disabled inline Datepickers.

Verification

  • The regression fails on the original code and passes with the fix. It checks the value and selection callback after disabling, then verifies that selection resumes when the input is enabled.
  • Datepicker QUnit suite in Chrome (37 tests, 599 assertions) and grunt eslint.
  • A normal click in Chrome leaves May 5 selected while the input is disabled.

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Datepicker changes a natively disabled input if its calendar is open

1 participant