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 readonly inside keydown handler
  • Prevented default behavior for Backspace and Delete
  • Ensured no value mutation occurs in readonly mode

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.