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: Dynamic mask change issue #3698

Closed
Zebnastien opened this issue Mar 3, 2023 · 1 comment · Fixed by #3714
Closed

InputMask: Dynamic mask change issue #3698

Zebnastien opened this issue Mar 3, 2023 · 1 comment · Fixed by #3714
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Zebnastien
Copy link

Zebnastien commented Mar 3, 2023

Describe the bug

When you try to change mask dynamically, nothing happen unless you rerender the component. This is not an expected behaviour. The reason seems to be the mask to be set on the onMounted hook inside the component.

Reproducer

https://codesandbox.io/s/primevue-input-mask-bug-c276yc

PrimeVue version

3.23.0

Vue version

3.x

Language

ALL

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

As seen on the codesanbox link, here are the steps:

  1. Create a page with an component.
  2. Set :mask=variableMask props.
  3. Dynamically change the mask value in "variableMask".
  4. contemplate the invariance of the mask in the input.

Expected behavior

Mask should change whenever a binded value changes.

@Zebnastien Zebnastien added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 3, 2023
@bahadirsofuoglu bahadirsofuoglu changed the title Component Name: Issue Title InputMask: Dynamic mask change issue Mar 9, 2023
@bahadirsofuoglu bahadirsofuoglu self-assigned this Mar 9, 2023
@bahadirsofuoglu bahadirsofuoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Mar 9, 2023
@bahadirsofuoglu bahadirsofuoglu added this to the 3.24.1 milestone Mar 9, 2023
@Zebnastien
Copy link
Author

Thanks for your work 👍🏼

There is still an issue. Switching mask dynamically while typing cause caret to jump to the end (or to the start in case of deletion). This make using this component hard if you plan to switch mask according to the start of your input value.

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants