Skip to content

How to limit the maxWidth of textbox? #7888

@Jiiiin

Description

@Jiiiin

I have a textbox with determined width and height,want to limit the input text to not exceed the set width, so I will give an error prompt and give up the content entered this time.

I have tried whether I can monitor text changes, or size changes, and handle them in events, but I haven't found a suitable event.

https://codesandbox.io/s/still-haze-zys42f?file=/src/App.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions