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

fix(SwipeCell): the click will be triggered after the touchend event on desktop #13040

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

inottn
Copy link
Collaborator

@inottn inottn commented Jul 31, 2024

fix #13037

Conflicts may need to be resolved after #13039 is merged.

@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.63%. Comparing base (423b0fe) to head (992077c).

Files Patch % Lines
packages/vant/src/swipe-cell/SwipeCell.tsx 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13040      +/-   ##
==========================================
- Coverage   89.66%   89.63%   -0.03%     
==========================================
  Files         257      257              
  Lines        6985     6987       +2     
  Branches     1723     1724       +1     
==========================================
  Hits         6263     6263              
- Misses        383      384       +1     
- Partials      339      340       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@H-Sven
Copy link

H-Sven commented Aug 4, 2024

请问这个fix 什么时候发布 release @inottn @hex-ci , 等着fix后项目上线

@chenjiahan chenjiahan merged commit 5afe27d into youzan:main Aug 4, 2024
3 checks passed
@chenjiahan
Copy link
Member

@H-Sven
Copy link

H-Sven commented Aug 5, 2024

@chenjiahan 4.9.4版本问题还存在, 并没有修复

示例代码
image

@H-Sven
Copy link

H-Sven commented Aug 5, 2024

@inottn @chenjiahan @hex-ci

@inottn
Copy link
Collaborator Author

inottn commented Aug 5, 2024

@H-Sven 可以创建一个 codesandbox demo ,或者提供一个可以复现问题的最小化的 GitHub 仓库

@H-Sven
Copy link

H-Sven commented Aug 5, 2024

@inottn
Copy link
Collaborator Author

inottn commented Aug 5, 2024

https://codesandbox.io/p/devbox/vant-swip-cell-demo-npqkx9

这个链接访问不了,可能访问权限没有公开。
还有你@ 的第三个人不是这个项目的维护者。后续不用@ ,直接评论就可以了,这边也是有通知的。

@H-Sven
Copy link

H-Sven commented Aug 5, 2024

https://codesandbox.io/p/devbox/vant-swip-cell-demo-npqkx9

这个链接访问不了,可能访问权限没有公开。 还有你@ 的第三个人不是这个项目的维护者。后续不用@ ,直接评论就可以了,这边也是有通知的。

权限打开了, 你再试试

@inottn
Copy link
Collaborator Author

inottn commented Aug 5, 2024

@H-Sven 可以使用 SwipeCell 组件的 click 事件替换 slot 内元素的 click 事件

@H-Sven
Copy link

H-Sven commented Aug 5, 2024

@H-Sven 可以使用 SwipeCell 组件的 click 事件替换 slot 内元素的 click 事件

点击其中一个item,触发了6次click, 而且右滑依然触发了click

https://codesandbox.io/p/devbox/vant-swip-cell-demo-npqkx9?file=%2Fsrc%2FApp.vue

@inottn
Copy link
Collaborator Author

inottn commented Aug 5, 2024

@H-Sven 可以使用 SwipeCell 组件的 click 事件替换 slot 内元素的 click 事件

点击其中一个item,触发了6次click, 而且右滑依然触发了click

https://codesandbox.io/p/devbox/vant-swip-cell-demo-npqkx9?file=%2Fsrc%2FApp.vue

可以通过参数区分触发点击的位置 https://vant-ui.github.io/vant/#/en-US/swipe-cell#events

@H-Sven
Copy link

H-Sven commented Aug 5, 2024

@H-Sven 可以使用 SwipeCell 组件的 click 事件替换 slot 内元素的 click 事件

点击其中一个item,触发了6次click, 而且右滑依然触发了click
https://codesandbox.io/p/devbox/vant-swip-cell-demo-npqkx9?file=%2Fsrc%2FApp.vue

可以通过参数区分触发点击的位置 https://vant-ui.github.io/vant/#/en-US/swipe-cell#events

好的, 虽然能解决我的问题, 但是在v-for逻辑里面, click输出的内容看起来很怪异,我点击的是最后一个item, 但是却输出了其他item, 这应该存在问题吧? 如果我的list有非常多item的话
image

@inottn
Copy link
Collaborator Author

inottn commented Aug 5, 2024

@H-Sven codesandbox 的 log 顺序不准,以浏览器控制台的 log 顺序为准

@H-Sven
Copy link

H-Sven commented Aug 5, 2024

@H-Sven codesandbox 的 log 顺序不准,以浏览器控制台的 log 顺序为准

浏览器控制台的结果也是一样的, 我只点击了其中一个item, 但是却console.log()了所有的item

无论点击页面何处, 都会触发所有的item的 outside事件, 不知道是不是设计如此

@inottn
Copy link
Collaborator Author

inottn commented Aug 5, 2024

@H-Sven codesandbox 的 log 顺序不准,以浏览器控制台的 log 顺序为准

浏览器控制台的结果也是一样的, 我只点击了其中一个item, 但是却console.log()了所有的item

无论点击页面何处, 都会触发所有的item的 outside事件, 不知道是不是设计如此

是的设计如此,顾名思义,点击 SwipeCell 组件外面会触发 outside 事件

@H-Sven
Copy link

H-Sven commented Aug 5, 2024

@H-Sven codesandbox 的 log 顺序不准,以浏览器控制台的 log 顺序为准

浏览器控制台的结果也是一样的, 我只点击了其中一个item, 但是却console.log()了所有的item
无论点击页面何处, 都会触发所有的item的 outside事件, 不知道是不是设计如此

是的设计如此,顾名思义,点击 SwipeCell 组件外面会触发 outside 事件

好的, 明白了。 感谢解答

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] SwipeCell 滑动单元格 PC上侧滑后松开鼠标按键,会触发 click 事件
4 participants