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 placeHolder of TreeSelect is blocked when the search b… #2566

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

YyumeiZhang
Copy link
Collaborator

@YyumeiZhang YyumeiZhang commented Nov 13, 2024

…ox is in trigger, single selection

中文模板 / 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 #

问题原因:
修复 #2292 时候,引入负值的 z-index 。负值的 z-index 会处于层叠上下文的下方,原来在 placeholder 层设置了 z-index 为 -1, 预期是想要实现

  1. 当 input 没有被 focus 时,placeholder 层位于 input 框的上层,这样能够保证 ReactNode 类型的 label 的一些 hover功能正常触发(比如被 tooltip 包裹)。
  2. 当 input 被 focus 后,input 无输入文本时,placeholder 位于 input 框的下层,hover input 框不会导致 placeholder 的 hover 功能被触发。

为什么在开发阶段没有发现这个问题?
有 cypress 测试用例覆盖,TreeSelect 的 search Position 用例,但由于 storybook 中背景没有设置颜色,因此即使负值的 z-index 位于层叠上下文的下方,仍然能够显示出来,而官网中,用例区域有背景色(-semi- color-bg-0),遮挡住了负值 z-index 的文本。因此两者的表现不同。

修复方式
去掉 placeholder 文本层的负值的 z-index,当 searchPosition 在 trigger中并且 focus 的状态下,设置 input 的wrapper 层的 z-index 为 1,保证此时 input 在文本上方

Changelog

🇨🇳 Chinese

  • Fix: 修复当单选,搜索框在 trigger 时,TreeSelect 的 placeholder被遮挡问题 ,影响版本 2.61.0-2.69.0

🇺🇸 English

  • Fix: Fix the problem that the placeholder of TreeSelect is blocked when single selection and search box are in trigger, affecting versions v2.61.0 - 2.69.0

Checklist

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

Other

  • Skip Changelog

Additional information

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 41b2a3d:

Sandbox Source
pr-story Configuration

Copy link

cypress bot commented Nov 13, 2024

semi-design    Run #2915

Run Properties:  status check passed Passed #2915  •  git commit 6660a8cf9a ℹ️: Merge 41b2a3dc1ff9f8c8aac2d105d7057b4c2e34dad8 into e5c98a0dcec045fd50521e951f96...
Project semi-design
Branch Review fix/treeSelect-single-placeholder
Run status status check passed Passed #2915
Run duration 07m 42s
Commit git commit 6660a8cf9a ℹ️: Merge 41b2a3dc1ff9f8c8aac2d105d7057b4c2e34dad8 into e5c98a0dcec045fd50521e951f96...
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 275
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@DaiQiangReal DaiQiangReal merged commit c9d5dba into main Nov 18, 2024
11 checks passed
@DaiQiangReal DaiQiangReal deleted the fix/treeSelect-single-placeholder branch November 18, 2024 03:52
Copy link

cypress bot commented Nov 18, 2024

semi-design    Run #2934

Run Properties:  status check passed Passed #2934  •  git commit c9d5dba0db: Merge pull request #2566 from DouyinFE/fix/treeSelect-single-placeholder
Project semi-design
Branch Review main
Run status status check passed Passed #2934
Run duration 08m 06s
Commit git commit c9d5dba0db: Merge pull request #2566 from DouyinFE/fix/treeSelect-single-placeholder
Committer 代强
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 275
⚠️ 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