-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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] abnormal focus when click tags #13699
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🧪 Playground Preview: https://element-plus.run/?pr=13699 |
tolking
changed the title
fix(components): [select] abnormal focus when click tags
WIP: fix(components): [select] abnormal focus when click tags
Jul 22, 2023
tolking
changed the title
WIP: fix(components): [select] abnormal focus when click tags
fix(components): [select] abnormal focus when click tags
Jul 22, 2023
thanks for fix! please approve it, very annoying bug |
chenxch
approved these changes
Jul 28, 2023
btea
approved these changes
Jul 30, 2023
btea
reviewed
Jul 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a test case?
consultation-applio
pushed a commit
to consultation-applio/element-plus
that referenced
this pull request
Nov 10, 2023
…s#13699) * fix(components): [select] abnormal focus when click tags closed element-plus#13665 * fix(components): [select] clearable * chore(components): [select] remove console * fix: the setTimeout function may bring some side effects * fix: remove role * test(components): [select] add some test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closed #13665, close #13487, close #13750
before
after
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.Description
🤖 Generated by Copilot at 9e3e21f
This pull request enhances the accessibility and keyboard interaction of the select component and its multiple variant. It adds or modifies some attributes and methods related to focus and role in
select.vue
anduseSelect.ts
. It also fixes some bugs and refactors some code in these files.Related Issue
Fixes #___.
Explanation of Changes
🤖 Generated by Copilot at 9e3e21f
role
,tabindex
, andclick
attributes and handler to thetags
element (link)useFocus
fromselect.vue
(link)focus
method to themethods
object and theexpose
function of theselect.vue
component, which is a proxy for thefocus
method defined inuseSelect.ts
(link, link)focus
methods from thesetup
function and theexpose
function of theselect.vue
component (link, link)focused
state to theuseSelectStates
function inuseSelect.ts
, which indicates whether the select component is focused or not (link)resetInputState
function inuseSelect.ts
, which causes the select component to lose focus when cleared or closed (link)focus
method in thehandleClear
function inuseSelect.ts
, which ensures that the select component remains focused after clearing (link)ignoreFocusEvent
variable with thefocused
state in thehandleFocus
function inuseSelect.ts
, which is a more robust way to track the focus status and avoid unnecessary events (link)focused
state totrue
in thehandleFocus
function inuseSelect.ts
, which updates the state accordingly when the select component is focused (link)handleBlur
function inuseSelect.ts
to check for thetagTooltipRef
value and set thefocused
state tofalse
, which improves the focus management and accessibility and prevents theblur
event from being emitted when the user focuses on the tooltip content or the select component itself (link)focus
method in thehandleComposition
function inuseSelect.ts
, which makes the code more concise and consistent (link)focus
method to the return value of theuseSelect
function inuseSelect.ts
, which exposes the method to theselect.vue
component (link)