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

InputNumber weird behavior when using min value & allow-empty=false together #7045

Closed
4 tasks
TheZlodziej opened this issue Jan 4, 2025 · 1 comment
Closed
4 tasks
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@TheZlodziej
Copy link
Contributor

TheZlodziej commented Jan 4, 2025

Describe the bug

When using InputNumber with :allow-empty="false" and :min value, when entering empty text, the cursor stays at 0 position while the value is set to 0. This causes errors when inserting numbers and forcing user to either select all the text and replace it or manually move the cursor.

Pull Request Link

#7044

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-46gqt1xb?file=src%2FApp.vue

Environment

it's very nice and warm

Vue version

3

PrimeVue version

4

Node version

20

Browser(s)

No response

Steps to reproduce the behavior

  1. type any value
  2. remove it with backspace
  3. mess around with entering value
  4. try inserting negative value

just play with it a bit in general, it's very hard to say but easily noticable

Expected behavior

After replacing the empty value with 0, the cursor should be moved tho 1st position (or just after the 0...)

@TheZlodziej TheZlodziej added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 4, 2025
@mertsincan mertsincan added this to the 4.3.0 milestone Jan 6, 2025
@github-project-automation github-project-automation bot moved this to Review in PrimeVue Jan 6, 2025
@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 6, 2025
@TheZlodziej
Copy link
Contributor Author

Recording.2025-01-07.122934.mp4

@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Jan 8, 2025
@tugcekucukoglu tugcekucukoglu self-assigned this Jan 8, 2025
@github-project-automation github-project-automation bot moved this from Review to Done in PrimeVue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
Status: Done
Development

No branches or pull requests

3 participants