mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge pull request #10903 from 2betop/fix-image-gallery
fix: 修复图片放大功能右键也会触发图片移动的问题
This commit is contained in:
commit
8e77ccfa7d
@ -150,6 +150,12 @@ export class ImageGallery extends React.Component<
|
||||
|
||||
@autobind
|
||||
onMouseDown(event: MouseEvent) {
|
||||
const isLeftButton =
|
||||
(event.button === 1 && window.event !== null) || event.button === 0;
|
||||
if (!isLeftButton || event.defaultPrevented) return;
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
this.galleryMain?.classList.add('is-dragging');
|
||||
document.body.addEventListener('mousemove', this.onMouseMove);
|
||||
document.body.addEventListener('mouseup', this.onMouseUp);
|
||||
|
Loading…
Reference in New Issue
Block a user