Skip to content

TextInput Paste occurs twice when close to maxLength #24766

Closed
@Milesc22

Description

@Milesc22

🐛 Bug Report

React-Native 0.55.1
Device: iPhone X, iOS 12.1.2

When pasting into a TextInput with a maxLength the paste seems to occur twice if the size of the clipboard text is more than half as long as the remaining characters. E.g. maxLength = 150, type 121 chars (29 remain), paste 15 chars. The TextInput will then be populated with the copied 15 as well as and additional 14/15 of the copied text.

To Reproduce

Paste more than half of the remaining characters into a TextInput with maxLength defined.

Expected Behavior

The paste action should only paste once regardless of how close to maxLength we are.

Environment

Environment:
OS: macOS 10.14.4
Node: 8.11.1
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 10.1 Build version 10B61
Android Studio: 3.4 AI-183.5429.30.34.5452501

Packages: (wanted => installed)
react: 16.3.2 => 16.3.2
react-native: 0.55.1 => 0.55.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions