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): [cascader] add focus and blur event when set filterable #11273

Merged
merged 4 commits into from
Feb 18, 2023

Conversation

btea
Copy link
Collaborator

@btea btea commented Jan 13, 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.

fix #11220

@github-actions
Copy link

github-actions bot commented Jan 13, 2023

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label Jan 13, 2023
@github-actions
Copy link

github-actions bot commented Jan 13, 2023

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

@ryuhangyeong
Copy link
Member

@btea Hello~ Can you elaborate more on the issue? I'm not sure what the problem is.

@btea
Copy link
Collaborator Author

btea commented Feb 5, 2023

If filterable and multiple are set at the same time, focus and blur events cannot be triggered.
before

after

@ryuhangyeong
Copy link
Member

OK! Thank you for your kind explanation!

@btea btea requested a review from tolking February 17, 2023 01:11
@tolking
Copy link
Member

tolking commented Feb 17, 2023

It can also optimize the focus. At present, when you press the Tab key, ElInput is triggered for the first time and input is triggered for the second time. You should use tabindex to avoid the first trigger.

@btea
Copy link
Collaborator Author

btea commented Feb 17, 2023

It can also optimize the focus. At present, when you press the Tab key, ElInput is triggered for the first time and input is triggered for the second time. You should use tabindex to avoid the first trigger.

Good catch 👍

@tolking
Copy link
Member

tolking commented Feb 17, 2023

It seems necessary to add focus class to ElInput

@btea
Copy link
Collaborator Author

btea commented Feb 17, 2023

Do you mean to add is-focus here?

:class="nsCascader.e('search-input')"

@tolking
Copy link
Member

tolking commented Feb 17, 2023

for ElInput

Currently, there is no style when using the Tab key to focus.

@tolking
Copy link
Member

tolking commented Feb 17, 2023

The judgment condition here is insufficient. It cannot accurately determine whether the component is in the focus state

Link

@btea
Copy link
Collaborator Author

btea commented Feb 17, 2023

I see, indeed as you said, the is-focus judgment ignores el-cascader__search-input.

Co-authored-by: qiang <qw13131wang@gmail.com>
Copy link
Member

@tolking tolking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@btea btea merged commit 8dfbddb into dev Feb 18, 2023
@btea btea deleted the fix/cascader-focus-blur branch February 18, 2023 13:58
@element-bot element-bot mentioned this pull request Feb 19, 2023
3 tasks
loosheng pushed a commit to loosheng/element-plus that referenced this pull request Mar 26, 2023
…ble (element-plus#11273)

* fix(components): [cascader] add focus and blur event when set filterable

* feat: add tabindex

* feat: update focus class

* Update packages/components/cascader/src/cascader.vue

Co-authored-by: qiang <qw13131wang@gmail.com>

---------

Co-authored-by: qiang <qw13131wang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CommitMessage::Qualified Qualified commit message
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Component] [cascader] el-cascader
3 participants