Splitter: Does not accept 0
as a valid value
#6967
Labels
Status: Pending Review
Issue or pull request is being reviewed by Core Team
0
as a valid value
#6967
Describe the bug
The splitter component does not allow you to set
0
as a valid value for thesize
property. On these lines here, if thesize
property is set to0
, it would evaluate itfalse
, making thepanelnitialSize
to benull
, which on the next line would set it's width to 33% (100 / 3 panels).Reproducer
https://stackblitz.com/edit/primevue-4-vite-issue-template-6hwcyho7?file=src%2FApp.vue&file=src%2Fmain.js
PrimeVue version
4.2.4
Vue version
4.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
If you click the button in the reproduction case, you'll see that the size property toggles between 20 and 0 on push. When the
size = 0
we would expect the splitter panel on the left to disappear, not to expand to 33%.Expected behavior
Having adjustable panels like this that you can toggle their expansion on/off is quite a common feature in modern apps and, given that
0
is technically an actual width, this seems to be a bug. I would expect that I should be able to put 0 as an actual width in order to hide that splitter panel.The text was updated successfully, but these errors were encountered: