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

feat(Tooltip,Popover): add the exist props #2073

Open
wants to merge 4 commits into
base: release
Choose a base branch
from

Conversation

sunsunmonkey
Copy link

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

Feat #1648

Changelog

🇨🇳 Chinese

  • Feat: 给组件Tooltip,Popover添加了exist props

🇺🇸 English

  • Feat: add the exist props for Tooltip,Popover

Checklist

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

Other

  • Skip Changelog

Additional information

Copy link

codesandbox-ci bot commented Feb 17, 2024

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 7f61672:

Sandbox Source
pr-story Configuration

@pointhalo pointhalo self-requested a review March 4, 2024 07:35
@pointhalo pointhalo self-assigned this Mar 4, 2024
@pointhalo
Copy link
Collaborator

看了一下,这个PR暂时没法合入

<Tooltip exist={flag} content='xxx' >chidlren</Tooltip>
如果定位是 flag ? <Tooltip content='xxxx'> chidren </Tooltip> : null 的语法糖的话,
还需要有以下逻辑修改

  1. exist 不仅仅是需要在 dom render 上的判断,对事件的注册、卸载也需要有区别。
    init时初始化时,exist={false} 的情况下,像 focus、mouseEnter、keyboard这种事件其实都不需要注册

  2. exist 如果动态变更

  • true -> false,对应的事件也应该卸载(此前是统一在组件销毁时卸载)
  • false -> true,如果此前未注册trigger对应事件,也应该注册上

此外 adapter state、foundation this 上对于visible的状态存储也应该更新,否则会出现值与render 脱节的情况

@sunsunmonkey
Copy link
Author

改了事件了 ,"此外 adapter state、foundation this 上对于visible的状态存储也应该更新,否则会出现值与render 脱节的情况" 这句有点没太明白咋改

@pointhalo
Copy link
Collaborator

改了事件了 ,"此外 adapter state、foundation this 上对于visible的状态存储也应该更新,否则会出现值与render 脱节的情况" 这句有点没太明白咋改

我这边后续会接着改一下。顺便加上一些测试用例。

@sunsunmonkey
Copy link
Author

改了事件了 ,"此外 adapter state、foundation this 上对于visible的状态存储也应该更新,否则会出现值与render 脱节的情况" 这句有点没太明白咋改

我这边后续会接着改一下。顺便加上一些测试用例。

get

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