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 Report] Select内置的滚动条Bar的事件mouseup丢失问题 #23017

Open
TigerWFH opened this issue Dec 31, 2024 · 1 comment
Open

[Bug Report] Select内置的滚动条Bar的事件mouseup丢失问题 #23017

TigerWFH opened this issue Dec 31, 2024 · 1 comment

Comments

@TigerWFH
Copy link

TigerWFH commented Dec 31, 2024

Element UI version

2.15.14

OS/Browsers version

Mac/131.0.6778.205

Vue version

2.6.10

Reproduction Link

https://codesandbox.io/p/sandbox/virtuallist-1-forked-kc7kql

Steps to reproduce

任意一个select组件,出现滚动条。点击选中滚动条,鼠标移动,移除可操作范围。然后鼠标回到对应页面内,就会会触发Bar组件的mousemove事件,导致逻辑反复执行。

如果对应实例已经销毁,就会导致JS异常Cannot read properties of undefined (reading 'offsetHeight')

What is Expected?

完善组件逻辑,增加mouseup事件丢失的降级方案
1、增加mouseleave事件,防止因操作移除操作区域导致mouseup事件丢失,mouseup的逻辑未执行,带来的非预期问题
2、增加逻辑,阻止浏览器触发drag事件,导致mouseup事件丢失

What is actually happening?

对于Bar组件,当mouseup丢失后,会导致mousemove事件一直挂载在document,当鼠标回到文档哪,进而触发mousemove事件,引起非预期问题

@TigerWFH
Copy link
Author

不支持视频,上传不了

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

1 participant