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

SELECT: hide clear button when options is empty in Dropdown #6084

Closed
akshayaqburst opened this issue Jul 19, 2024 · 0 comments · Fixed by #6085
Closed

SELECT: hide clear button when options is empty in Dropdown #6084

akshayaqburst opened this issue Jul 19, 2024 · 0 comments · Fixed by #6085
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@akshayaqburst
Copy link
Contributor

Describe the bug

Hi!
Put a SELECT component with "showClear" option, link its options to a collection that is a react state. Let the user select a value. Then clear the options collection. The Dropdown component will show no value but the clear icon ("X") will still stay visible.
image

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-cnd4hj?file=src%2FApp.vue

PrimeVue version

4.0.0

Vue version

4.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

Add a SELECT component that has its options filled dynamically
Choose a value in the Select component
Reset state linked to the options of the Dropdown
The Dropdown will be repainted without a selected value (correct) but the clear icon will still be visibile (wrong behaviour)

Expected behavior

If you programmatically empties the values of the Dropdown, if previously visible the Clear icon should disappear

@akshayaqburst akshayaqburst added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 19, 2024
akshayaqburst pushed a commit to qburst/primevue_qb_7 that referenced this issue Jul 19, 2024
tugcekucukoglu added a commit that referenced this issue Jul 22, 2024
fix: #6084, SELECT: hide clear button when options is empty in Dropdown
@tugcekucukoglu tugcekucukoglu 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 Jul 22, 2024
@tugcekucukoglu tugcekucukoglu added this to the 4.0.1 milestone Jul 22, 2024
tugcekucukoglu added a commit that referenced this issue Jul 22, 2024
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