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

Splitter: Does not accept 0 as a valid value #6967

Open
K3TH3R opened this issue Dec 16, 2024 · 0 comments
Open

Splitter: Does not accept 0 as a valid value #6967

K3TH3R opened this issue Dec 16, 2024 · 0 comments
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team

Comments

@K3TH3R
Copy link

K3TH3R commented Dec 16, 2024

Describe the bug

The splitter component does not allow you to set 0 as a valid value for the size property. On these lines here, if the size property is set to 0, it would evaluate it false, making the panelnitialSize to be null, 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.

@K3TH3R K3TH3R added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 16, 2024
@tugcekucukoglu tugcekucukoglu 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 Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

No branches or pull requests

2 participants