fix(input-otp): prevent deletion when readonly is true by KanhaiyaPandey · Pull Request #30983 · ionic-team/ionic-framework
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.
This PR ensures that all keyboard interactions that modify the value are prevented when readonly is true.
Changes
- Added guard for
readonlyinside keydown handler - Prevented default behavior for Backspace and Delete
- Ensured no value mutation occurs in readonly mode
How to Test
- Add
readonlytoion-input-otp - Attempt to type → no input allowed
- Press Backspace/Delete → no characters removed
Behavior now matches expected readonly semantics.