Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputMask: Pasting does not respect the cursor selection #5285

Closed
Triggs125 opened this issue Nov 10, 2023 · 0 comments · Fixed by #5286
Closed

InputMask: Pasting does not respect the cursor selection #5285

Triggs125 opened this issue Nov 10, 2023 · 0 comments · Fixed by #5286
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@Triggs125
Copy link
Contributor

Describe the bug

The input mask component currently pastes content at the first empty value position (end of the value) instead of the cursor's selection.

This is directly from the primereact website:

Screen.Recording.2023-11-10.at.12.51.09.PM.mov

Reproducer

https://codesandbox.io/s/primereact-test-forked-7yl2f8

PrimeReact version

10.0.9

React version

17.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Add an input mask of "--___".
  2. Type in "111111222".
  3. Highlight the "222" and cut it from the value.
  4. Move your cursor to the left until it is somewhere inside of the "1"s.
  5. Paste the previously cut "2"s.
  6. See that "222" is appended to the end of the value instead of where the cursor was.

Expected behavior

Pasting a value should respect the cursor's start/end selection and then place the cursor at the end of the newly pasted content.

@Triggs125 Triggs125 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 10, 2023
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 10, 2023
@melloware melloware added this to the 10.0.10 milestone Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants