-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Menubar: Custom locale config overwriting default untouched config properties #4270
Comments
Looking at the source code for PrimeVue install function (https://github.com/primefaces/primevue/blob/prod/components/lib/config/PrimeVue.js) we can see the problem is the use of spread ( |
Actually, you have already said the solution is using spread operator. Due to the config option being a reactive object, spread operation can be used also for its nested objects. I have forked your example and made some changes: https://codesandbox.io/s/serverless-platform-5td2z9?file=/src/main.js:4291-4311 Thanks for your contribution! |
Hello, it's the same problem with Rating component. TypeError: Cannot read properties of undefined (reading 'star') |
What did you actually change ? |
Describe the bug
Menubar component with MenuItems throws "Uncaught TypeError: Cannot read properties of undefined (reading 'navigation')" when custom locale options are set for PrimeVue. This stops the component with the Menubar from rendering.
When debugging, I noticed that the custom locale configurations overwrote the whole default configuration object passed to the Menubar component in its render function, not only the changed properties.
Reproducer
https://codesandbox.io/s/musing-mopsa-vf6ddf?file=/src/main.js:4302-4314
PrimeVue version
3.29.0 - 3.32.0
Vue version
3.x
Language
ALL
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
locale
configuration in your PrimeVue installation/injection (main.js/ts)Expected behavior
No error
The text was updated successfully, but these errors were encountered: