Datepicker changes a natively disabled input if its calendar is open

Aperta
#2,423 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@Xapollon430 ci sta già lavorando.

Dal 12/11/2026.

  • #2424 di @Xapollon430 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript, jquery
Ambito
frontend

Direzione di ricerca

Start with the Datepicker selection and disabled-input handling in the jQuery UI source, then inspect its Datepicker tests for coverage of selecting a date after the input becomes disabled while the calendar is open. Add a regression test for the reported steps; done means the date stays May 5 and onSelect does not run. Pull request #2424 is already open against this issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Steps to reproduce

With jQuery UI Datepicker and its theme loaded, add the following:

<input id="date" value="05/05/2027">
<button onclick="setTimeout(() => { document.querySelector('#date').disabled = true; }, 1500)">
  Disable in 1.5 seconds
</button>
<script>
  $("#date").datepicker({ dateFormat: "mm/dd/yy" });
</script>
  1. Click Disable in 1.5 seconds.
  2. Open the calendar before the timer fires.
  3. After the input becomes disabled, click May 12.

Expected: the input remains May 5 and onSelect does not run. Actual: the open calendar changes the disabled input to May 12 and runs onSelect.

Reproduced on jQuery UI 1.14.3-pre at dcf1055, with jQuery 4.0.0 and Chrome 157.0.8103.78 on macOS 27.0.1.

Chrome reproduction video

Lingua principale
JavaScript
Stelle
11.3k
Fork
5.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jquery/jquery-ui

Tutte le issue di jquery/jquery-ui

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.