-
Notifications
You must be signed in to change notification settings - Fork 23.2k
iOS: maxlength not enforced when pasting text via keyboard suggestions / internal paste #43683
Description
MDN URL
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input
What specific section or headline is this issue about?
Input text
What information was incorrect, unhelpful, or incomplete?
On iOS devices, when using the native keyboard (especially suggestion bar / internal paste), input fields with a maxlength attribute allow more characters than the defined limit.
This behavior appears inconsistent with expected HTML input constraints and may lead to unexpected UI or validation issues.
Steps to Reproduce
Open a webpage with an <input> or <textarea> having maxlength (e.g., maxlength="10")
Use an iOS device (Safari or WebView)
Copy a long string (e.g., 20+ characters)
Paste using:
Keyboard suggestion bar, OR
iOS paste option from keyboard
Observe the input value
Expected Behavior
The input should strictly enforce the maxlength constraint and truncate or reject excess characters.
Actual Behavior
The pasted content exceeds the defined maxlength and is fully inserted into the input field.
Environment
Device: iPhone (specify model if possible)
OS: iOS (e.g., 17.x)
Browser: Safari / WebView
Keyboard: iOS native keyboard
Notes
This seems specific to iOS input handling rather than standard browser validation.
Could be related to how paste events or input events are processed in iOS.
What did you expect to see?
- The input shouldn't allow more characters than maxlength
Do you have any supporting links, references, or citations?
Attaching video reference : https://drive.google.com/drive/folders/1OC8pCEaEMGB-gK2da-igYGjAiIfcTsp4
Do you have anything more you want to share?
No response