v6: OTP input keeps the rest of a selection when you type over it

Aperta Adatta ai principianti
#43,323 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@thejesh23 ci sta già lavorando.

Dal 8/11/2026.

  • #43325 di @thejesh23 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript

Direzione di ricerca

Inizia in js/src/otp-input.ts, in _handleBeforeInput(), dove l’issue dice che il carattere viene scritto in selectionStart e che selectionEnd viene ignorato. Controlla i test esistenti dell’input OTP e aggiungi o aggiorna un caso che selezioni tutti gli slot e digiti 9. Il risultato atteso è che il valore ottenuto sia 9 e che il test passi.

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

Descrizione

bug confirmed has-pr js v6
Prerequisites
  • I have searched for duplicate or closed issues
  • I have validated any HTML to avoid common problems
  • I have read the contributing guidelines
Describe the issue

In an OTP input, typing over a selection of several slots only overwrites the first slot.

Steps:

  1. Fill an OTP input with 123456.
  2. Press Ctrl/Cmd+A, then type 9.

Expected: the value is 9, like Backspace, which clears the whole selection.
Actual: the value is 923456.

Reduced test cases

_handleBeforeInput() in js/src/otp-input.ts writes the character at selectionStart and ignores selectionEnd.

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

main (v6.0.0-alpha.1)

Lingua principale
MDX
Stelle
175k
Fork
78.7k
Merge medio
1g 7h
PR unite (30g)
103

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 twbs/bootstrap

Tutte le issue di twbs/bootstrap

Issue simili

Altre issue su Accessibility

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.