Open homersimpsons opened 7 months ago
Same in v.3.49.1 @homersimpsons have you found a temporary solution?
Edit: I set slot-char=" " (with a white space) and it works.
@homersimpsons have you found a temporary solution?
Having a not-empty slot-char
works, but on our side we did not want this behaviour as the user will "see" the spaces.
So we chose to manually call the updateValue
function:
const inputMask = ref<HTMLElement | null>(null);
watch(
() => props.modelValue,
async () => {
await nextTick(() => inputMask.value?.updateValue());
}
);
Describe the bug
InputMask component does not react to model updates when we use the
slot-char
property.Reproducer
https://stackblitz.com/edit/primevue-create-vue-issue-template-5zrdku?file=src%2FApp.vue
PrimeVue version
3.47.2
Vue version
3.x
Language
ALL
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
The value should display in the
InputMask
.Diagnostic
It works with a different "user-pattern"
The component work with the following steps:
Note that if you then remove the input value completely it does not work anymore.
Vue-reactivity works
We can clearly see that the value is correctly updated in the view by vue.
It works without
slot-char
On https://stackblitz.com/edit/primevue-create-vue-issue-template-5zrdku?file=src%2FApp.vue if you remove the
slot-char=""
property it worksIt works when calling
updateValue
By attaching a
ref
to the component and callingupdateValue
it works:https://github.com/primefaces/primevue/blob/d7c25df7b02a5c9791be50a7769201b3508c0d59/components/lib/inputmask/InputMask.vue#L417
Reproduction Video
Screencast from 11-03-2024 14:29:10.webm
If you need any further details feel free to ask.