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: [Select] Fixed the problem that when the search panel is opened,… #2668

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

YyumeiZhang
Copy link
Collaborator

@YyumeiZhang YyumeiZhang commented Jan 10, 2025

… after the search input loses focus, it cannot be focused again by clicking it

中文模板 / 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 #
复现代码:

import React from 'react';
import { Select } from '@douyinfe/semi-ui';

() => (
    <>
        <Select filter style={{ width: 180 }} placeholder="带搜索功能的单选">
            <Select.Option value="douyin">抖音</Select.Option>
            <Select.Option value="ulikecam">轻颜相机</Select.Option>
            <Select.Option value="jianying">剪映</Select.Option>
            <Select.Option value="xigua">西瓜视频</Select.Option>
        </Select>
    </>
);

问题表现:

关联问题:#2547

  1. 输入搜索内容后,点击面板的【暂无数据】部分,input 失去焦点,触发 input 隐藏行为,点击trigger,想要再次聚焦,input 此时已经隐藏,无法再次聚焦
    20250110114812_rec_
  2. 输入搜索内容后,切换到其他标签页,再次切换回来,input 失去是失去焦点的状态,且触发 input 隐藏行为,点击trigger,想要再次聚焦,input 此时已经隐藏,无法再次聚焦
    20250110115026_rec_

Changelog

🇨🇳 Chinese

  • Fix: 修复单选,可搜索的 Select 在面板打开状态下失去焦点后,无法再次通过点击 trigger 聚焦问题

🇺🇸 English

  • Fix: Fixed the problem that after the single-select and searchable Select loses focus when the panel is open, it cannot be focused again by clicking the trigger.

Checklist

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

Other

  • Skip Changelog

Additional information

… after the search input loses focus, it cannot be focused again by clicking it
@YyumeiZhang YyumeiZhang requested a review from YannLynn January 10, 2025 03:57
Copy link

codesandbox-ci bot commented Jan 10, 2025

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 719295b:

Sandbox Source
pr-story Configuration

Copy link

cypress bot commented Jan 10, 2025

semi-design    Run #3053

Run Properties:  status check passed Passed #3053  •  git commit 45bed20242 ℹ️: Merge 719295b6683ee466a6891f4d76241ac2d20d4899 into 26e6825d4037458f7ffcac9aa6f7...
Project semi-design
Branch Review find/select-focus
Run status status check passed Passed #3053
Run duration 08m 03s
Commit git commit 45bed20242 ℹ️: Merge 719295b6683ee466a6891f4d76241ac2d20d4899 into 26e6825d4037458f7ffcac9aa6f7...
Committer YyumeiZhang
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 11
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 281
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

… after the search input loses focus, it cannot be focused again by clicking it
@YannLynn YannLynn merged commit df507ba into main Jan 24, 2025
9 checks passed
@YannLynn YannLynn deleted the find/select-focus branch January 24, 2025 08:10
Copy link

cypress bot commented Jan 24, 2025

semi-design    Run #3054

Run Properties:  status check passed Passed #3054  •  git commit df507ba206: fix: [Select] Fixed the problem that when the search panel is opened,… (#2668)
Project semi-design
Branch Review main
Run status status check passed Passed #3054
Run duration 08m 06s
Commit git commit df507ba206: fix: [Select] Fixed the problem that when the search panel is opened,… (#2668)
Committer YyumeiZhang
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 11
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 281
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

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.

2 participants