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: fixed the problem that after selecting a radio option, clicking outside does not trigger the onblur event #1977

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

YannLynn
Copy link
Collaborator

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR description

Fixes #

Changelog

🇨🇳 Chinese

  • Fix: 修复 select 单选选择选项后,点击外部不触发 onblur 事件问题

🇺🇸 English

  • Fix: fixed the problem that after selecting a radio option, clicking outside does not trigger the onblur event

Checklist

  • Test or no need
  • Document or no need
  • Changelog or no need

Other

  • Skip Changelog

Additional information

@YannLynn YannLynn requested a review from YyumeiZhang December 12, 2023 09:36
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 683789c:

Sandbox Source
pr-story Configuration
Semi Design: Simple Story Configuration

Copy link

cypress bot commented Dec 12, 2023

Passing run #2117 ↗︎

0 234 10 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge 683789c into c7982af...
Project: semi-design Commit: 37862fb286 ℹ️
Status: Passed Duration: 10:08 💡
Started: Dec 12, 2023 10:04 AM Ended: Dec 12, 2023 10:14 AM

Review all test suite changes for PR #1977 ↗︎

@YyumeiZhang YyumeiZhang merged commit 7ce0d85 into main Dec 15, 2023
9 checks passed
@YyumeiZhang YyumeiZhang deleted the fix-select-blur branch December 15, 2023 10:11
@@ -363,6 +363,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
this.close(e);
this._notifyBlur(e);
this._adapter.updateFocusState(false);
this._adapter.unregisterClickOutsideHandler();
Copy link
Collaborator

Choose a reason for hiding this comment

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

不能将 unregister 的操作跟空白点击绑定在一起。
假设用户是点击后打开 Select LOptionList,但是又通过 ref.close() 方式手动关闭了 select,此时是不存在触发 clickOutSide 逻辑的。 这个监听就会一直残留。但实际上 select 已经收起了,有残留监听是不合理的。

YannLynn added a commit that referenced this pull request Dec 26, 2023
@YannLynn YannLynn mentioned this pull request Dec 26, 2023
15 tasks
pointhalo pushed a commit that referenced this pull request Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants