Skip to content

iOS: maxlength not enforced when pasting text via keyboard suggestions / internal paste #43683

@rohanvachheta

Description

@rohanvachheta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:HTMLHypertext Markup Language docsclosed: browser bugThis is a browser bug, not a content bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions