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

Dropdown: After selecting an option, clearing the value using close icon should clear the filter input #5060

Closed
akshayaqburst opened this issue Jan 11, 2024 · 7 comments · Fixed by #5061
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@akshayaqburst
Copy link
Contributor

Describe the bug

Dropdown: After selecting an option, clearing the value using close icon should clear the filter input.

Reproducer

https://stackblitz.com/edit/mfbhvb?file=src%2FApp.vue

PrimeVue version

3.46

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to https://primevue.org/dropdown/#filter
  2. Pass showClear prop to clear the selected option using close icon.
  3. Type desired value in the dropdown's filter field.
  4. Select an option based on the ones provided post-filtering.
  5. Unwrap dropdown.
  6. Observe that the previously typed value in the filter field has not been cleared.
  7. Clear the dropdown value by clicking on the clear icon.
  8. Observe that the previously typed value in the filter field has not been cleared.

Expected behavior

On clicking the clear icon, the previously typed value in the filter should clear.

@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 Jan 11, 2024
akshayaqburst pushed a commit to qburst/primevue_qb_3 that referenced this issue Jan 11, 2024
…he value using close icon should clear the filter input
@akshayaqburst
Copy link
Contributor Author

akshayaqburst commented Jan 11, 2024

This is an issue that I recently fixed in Primeng. Link for reference - Primeng PR link for reference - primefaces/primeng#14511.

Also fixed the same in PrimeReact - primefaces/primereact#5736

@mertsincan
Copy link
Member

Hi,

Thanks a lot for your PR and enhancement! But, this is not the right behaviour. They are independent of each other. It is normal for the filter to remain when you clear the value. For example, when you try an editable Dropdown in the same case and delete the selected text without using clearIcon, the filter will still remain. Please try with clearIcon and without clearIcon.
https://stackblitz.com/edit/mfbhvb-nmjvvq?file=src%2FApp.vue

Best Regards,

@mertsincan mertsincan added Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior Resolution: Needs More Information More information about the issue is needed to find a correct solution and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 11, 2024
@mertsincan mertsincan added this to the 3.47.0 milestone Jan 11, 2024
@mertsincan mertsincan self-assigned this Jan 11, 2024
@mertsincan
Copy link
Member

Also, this type of enhancement can be supported with a prop and the filter can be cleared only when pressing clearIcon.

Prop's name;
resetFilterOnClear="true"
... another names :)

@akshayaqburst
Copy link
Contributor Author

I hope you are working on it. Let me know if you need my help in anything. Thanks,

@mertsincan
Copy link
Member

Honestly, a PR would be nice :)

@akshayaqburst
Copy link
Contributor Author

akshayaqburst commented Jan 11, 2024

Sure @mertsincan, will update the PR within next 12 hours

akshayaqburst pushed a commit to qburst/primevue_qb_3 that referenced this issue Jan 15, 2024
…he value using close icon should clear the filter input
@akshayaqburst
Copy link
Contributor Author

@mertsincan Updated the PR with the changes you requested.
#5061

mertsincan pushed a commit that referenced this issue Jan 16, 2024
…sing close icon should clear the filter input (#5061)

* fix: #5060, Dropdown: After selecting an option, clearing the value using close icon should clear the filter input

* fix: #5060, Dropdown: After selecting an option, clearing the value using close icon should clear the filter input

---------

Co-authored-by: Akshay Antony <[email protected]>
@mertsincan mertsincan added Type: New Feature Issue contains a new feature or new component request Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior Resolution: Needs More Information More information about the issue is needed to find a correct solution Type: New Feature Issue contains a new feature or new component request labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
2 participants