Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Setting optional chars by default on onPaste event #55

Open
Aspedm opened this issue Jul 6, 2022 · 3 comments
Open

Setting optional chars by default on onPaste event #55

Aspedm opened this issue Jul 6, 2022 · 3 comments

Comments

@Aspedm
Copy link

Aspedm commented Jul 6, 2022

  • I'm submitting a ...
    [X ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    When mask have optional characters as [000] and i trying paste some value less than required + optional, optional values are filled from start string.

  • Other information
    Reproduce link: https://codesandbox.io/s/antd-mask-input-onpaste-bug-dmxqrt

@dcn0503
Copy link

dcn0503 commented Jul 26, 2022

I found a workaround today that may be relevant to you - try event.preventDefault() on the onPaste event

@c01nd01r
Copy link

c01nd01r commented Aug 7, 2022

I was looking a solution for another bug related to pasting data in field, but @dcn0503 advice is helped too!
In @Aspedm codesandbox just copy first 4 digits and paste to field.

@QaseemLodhi
Copy link

thanks @dcn0503, you save my day 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants