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

[BUG] Slider 组件的 onMouseUp 事件触发时机 #2171

Closed
1 task done
zzc6332 opened this issue Apr 15, 2024 · 3 comments
Closed
1 task done

[BUG] Slider 组件的 onMouseUp 事件触发时机 #2171

zzc6332 opened this issue Apr 15, 2024 · 3 comments
Assignees
Labels
PR Welcome Welcome pull request :)

Comments

@zzc6332
Copy link
Contributor

zzc6332 commented Apr 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Which Component

Slider

Semi Version

2.56.0

Current Behavior

表现一:Slider 组件初始状态下,除了 handle 之外的元素如果被鼠标 down,那么当鼠标 up 时均无法触发组件的 mouseup 事件(以下将某元素被 mousedown 之后发生的 mouseup 都描述为该元素触发了 mouseup 事件)。一旦 handle 触发了 mouseup 事件后,track、rail、wrapper 均可以触发 mouseup 事件。见如下 gif:
1
[更新] 刚刚发现,实际上是触发过一次组件的 onMouseUp 之后,页面上所有元素的 mouseup 事件都会触发组件 onMouseUp 的回调。见如下 gif:
1-2

表现二:如果存在多个 Slider 组件,那么当拖动其中一个 Slider 的 handle 时,如果鼠标离开了当前 Slider,且位于另一个 Slider 的 handle 上方释放时,被操作的 Slider 仍会处于被拖动状态。见如下 gif:
2-1
2-2

Expected Behavior

表现一:Slider 组件的 mouseup 事件总是可以被所有组件元素触发,或者总是只能被 handle 触发。 [更新]页面的其它元素不触发 onMouseUp。
表现二:鼠标在任何地方被释放后都结束 Slider 的拖动状态。

Steps To Reproduce

任何时候都会出现。

ReproducibleCode

https://stackblitz.com/edit/vitejs-vite-t8agmi?file=src%2FApp.tsx

Environment

Node: 18.19.1
Browser: Chrome / Firefox

Anything else?

No response

@zzc6332 zzc6332 changed the title [BUG] <title>Slider 组件的 onMouseUp 事件触发 [BUG] Slider 组件的 onMouseUp 事件触发 Apr 15, 2024
@zzc6332 zzc6332 changed the title [BUG] Slider 组件的 onMouseUp 事件触发 [BUG] Slider 组件的 onMouseUp 事件触发时机 Apr 15, 2024
@pointhalo
Copy link
Collaborator

@DaiQiangReal need confirm

@DaiQiangReal
Copy link
Collaborator

是 Bug,我们准备修,但是最近人力比较紧张。。我们尽力排。也欢迎PR

@DaiQiangReal DaiQiangReal added the PR Welcome Welcome pull request :) label Apr 18, 2024
zzc6332 added a commit to zzc6332/semi-design that referenced this issue Apr 21, 2024
zzc6332 added a commit to zzc6332/semi-design that referenced this issue Apr 21, 2024
@zzc6332 zzc6332 mentioned this issue Apr 21, 2024
15 tasks
DaiQiangReal added a commit that referenced this issue May 15, 2024
@DaiQiangReal
Copy link
Collaborator

#2186 fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR Welcome Welcome pull request :)
Projects
None yet
Development

No branches or pull requests

3 participants