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

mousedown.stop will prevent color-picker to close when click outside #2709

Closed
moolex opened this issue Mar 30, 2022 · 5 comments
Closed

mousedown.stop will prevent color-picker to close when click outside #2709

moolex opened this issue Mar 30, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@moolex
Copy link

moolex commented Mar 30, 2022

TuSimple/naive-ui version (版本)

2.27.0

Vue version (Vue 版本)

3.2.31

Browser and its version (浏览器及其版本)

Chrome

System and its version (系统及其版本)

MacOS

Node version (Node 版本)

Reappearance link (重现链接)

https://codesandbox.io/s/naive-ui-color-picker-click-outside-9jo6gl?file=/src/App.vue

Reappearance steps (重现步骤)

Click case1, case2 in codesandbox and click outside

Expected results (期望的结果)

works as case2 (with onClickOutside from vueuse)

Actual results (实际的结果)

not works

Remarks (补充说明)

@github-actions github-actions bot added the untriaged need to sort label Mar 30, 2022
@07akioni 07akioni added bug Something isn't working and removed untriaged need to sort labels Mar 30, 2022
@Sepush
Copy link
Collaborator

Sepush commented Apr 5, 2022

@Sepush
Copy link
Collaborator

Sepush commented Apr 6, 2022

https://codesandbox.io/s/naive-ui-color-picker-click-outside-forked-6x2ry8?file=/src/App.vue

https://codesandbox.io/s/naive-ui-color-picker-click-outside-forked-mqqu4v?file=/src/App.vue 这样是有问题的

嗯 这样需要点击 400px 以外的才会有效 判断是否 clickout 的条件确实有点问题

@Talljack
Copy link
Contributor

Talljack commented Apr 6, 2022

https://codesandbox.io/s/naive-ui-color-picker-click-outside-forked-6x2ry8?file=/src/App.vue

https://codesandbox.io/s/naive-ui-color-picker-click-outside-forked-mqqu4v?file=/src/App.vue 这样是有问题的

嗯 这样需要点击 400px 以外的才会有效 判断是否 clickout 的条件确实有点问题

主要还是.stop了阻止了事件

@07akioni
Copy link
Collaborator

07akioni commented Apr 6, 2022

This is a bug, we'll try to fix it.

I think we should handle mousedown event in catch phase in evtd. Current it intercepts too late.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants