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

fix(components): [select] don't trigger remoteMethod when dropdown hides #13865

Closed
wants to merge 1 commit into from

Conversation

yj-liuzepeng
Copy link
Contributor

@yj-liuzepeng yj-liuzepeng commented Aug 3, 2023

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Description

The filterMethod or remoteMethod should not be triggered when the dropdown menu is hidden.

Related Issue

Fixes #13847
Related to Issue #9539, #10283, #11614, and PR #9587, #10218

Explanation of Changes

Regarding #9539, I think that when the select is clicked again, it should display the list of search results from the previous search. Additionally, triggering the filterMethod or remoteMethod again when the change event or blur event is triggered could have some negative impacts. I have reviewed other UI component libraries, such as Ant Design and Semi Design, and it is indeed the case.

@pull-request-triage
Copy link

👋 @yj-liuzepeng, thank you for contributing element-plus.

  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

@github-actions
Copy link

github-actions bot commented Aug 3, 2023

@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Hello @yj-liuzepeng, thank you for contributing to element-plus, please see our guideline to see how to make contribution

@github-actions
Copy link

github-actions bot commented Aug 3, 2023

🧪 Playground Preview: https://element-plus.run/?pr=13865
Please comment the example via this playground if needed.

@yj-liuzepeng
Copy link
Contributor Author

element plus playground

@yj-liuzepeng
Copy link
Contributor Author

I saw that you have submitted a pull request for this (#10218), i hope to get your suggestions! @btea

@btea
Copy link
Collaborator

btea commented Aug 15, 2023

I'm not sure if filterMethod and remoteMethod need to be triggered after select closes the drop-down box, but there have been multiple issues and PRs that have mentioned this recently, what do you think is the right behavior? cc @element-plus/backers

@tolking
Copy link
Member

tolking commented Aug 15, 2023

Because the input value will be cleared when the drop-down box is closed, I think that triggering the filterMethod and remoteMethod is a reasonable behavior.

Removing these codes will reproduce the original issues

In addition, this PR do not seem to be related to #13847 🤔️

@kooriookami
Copy link
Member

Fixed in 2.5.0

@kooriookami kooriookami closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Component] [select] 最新版2.3.8select的问题
4 participants