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

Notification 需要支持 pauseOnHover 属性 #48985

Closed
yociduo opened this issue May 20, 2024 · 5 comments
Closed

Notification 需要支持 pauseOnHover 属性 #48985

yociduo opened this issue May 20, 2024 · 5 comments

Comments

@yociduo
Copy link
Contributor

yociduo commented May 20, 2024

What problem does this feature solve?

hover 到 notifications 上时,可以选择是否暂停计时器
react-component/notification#322 (comment)

What does the proposed API look like?

pauseOnHover: boolean = true
@zombieJ
Copy link
Member

zombieJ commented May 22, 2024

默认已经是有这个能力了,要加这个 API 是为了停用这个功能么?

@yociduo
Copy link
Contributor Author

yociduo commented May 22, 2024

默认已经是有这个能力了,要加这个 API 是为了停用这个功能么?

现在的实现还是有点不一样的,现在不是暂停计时器,而是重新重新计时,加了进度条这个PR后会发现这个行为有些奇怪

@zombieJ
Copy link
Member

zombieJ commented May 22, 2024

现在的实现还是有点不一样的,现在不是暂停计时器,而是重新重新计时,加了进度条这个PR后会发现这个行为有些奇怪

如果是这样的话,看起来应该是没有进度条时 hover 重置,有进度条时 hover 暂停。作为默认行为就好了?感觉它不应该是一个透出的 API 到用户侧。

@yociduo
Copy link
Contributor Author

yociduo commented May 23, 2024

现在的实现还是有点不一样的,现在不是暂停计时器,而是重新重新计时,加了进度条这个PR后会发现这个行为有些奇怪

如果是这样的话,看起来应该是没有进度条时 hover 重置,有进度条时 hover 暂停。作为默认行为就好了?感觉它不应该是一个透出的 API 到用户侧。

我觉得不管有没有进度条,行为应该是统一的,当时加 progress bar 的时候就觉得 hover 的时候重置会有一些奇怪。如果需要改成默认行为的话,还需要改一下基础库,我稍后更新。

@afc163
Copy link
Member

afc163 commented May 23, 2024

https://fkhadra.github.io/react-toastify/introduction/ 行为保持一致。

@afc163 afc163 closed this as completed May 27, 2024
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

No branches or pull requests

3 participants