brandyscarney
changed the title
fix(input-otp): prevent deletion when readonly is true
fix(input-otp): prevent deletion and pasting when readonly is true
brandyscarney
changed the title
fix(input-otp): prevent deletion and pasting when readonly is true
fix(input-otp): prevent deletion and paste when disabled or readonly
os-davidlourenco pushed a commit that referenced this pull request
Mar 26, 2026…30983) Closes #30913 ## Description When `ion-input-otp` has the `readonly` prop set, typing is correctly blocked but users are still able to delete characters using the Backspace or Delete keys. When `disabled` or `readonly` are set, users are still able to paste into the component. ## Changes - Added guard for `disabled` and `readonly` inside `onInput` and `onPaste` handler - Prevented default behavior for `Backspace` and `Delete` when `readonly` is `true` - Return in `onKeydown` when `disabled` is `true` - Added e2e tests verifying the behavior ## How to Test 1. Add `readonly` to `ion-input-otp` 2. Attempt to type → no input allowed 3. Press Backspace/Delete → no characters removed Behavior now matches expected readonly semantics. --------- Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>