Skip to content
Snippets Groups Projects
Commit bc696947 authored by Phil Hughes's avatar Phil Hughes
Browse files

Merge branch '59942-fix-mr-swipe-diff-user-select' into 'master'

MR image diff swipe view: Disable user-select on drag

Closes #59942

See merge request gitlab-org/gitlab-ce!26884
parents e036cb04 7c61fb03
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -102,7 +102,7 @@ export default {
:style="{
width: onionMaxPixelWidth,
height: onionMaxPixelHeight,
'user-select': dragging === true ? 'none' : '',
'user-select': dragging ? 'none' : null,
}"
class="onion-skin-frame"
>
Loading
Loading
Loading
Loading
@@ -68,12 +68,10 @@ export default {
},
startDrag() {
this.dragging = true;
document.body.style.userSelect = 'none';
document.body.addEventListener('mousemove', this.dragMove);
},
stopDrag() {
this.dragging = false;
document.body.style.userSelect = '';
document.body.removeEventListener('mousemove', this.dragMove);
},
prepareSwipe() {
Loading
Loading
@@ -104,7 +102,13 @@ export default {
 
<template>
<div class="swipe view">
<div ref="swipeFrame" class="swipe-frame">
<div
ref="swipeFrame"
:style="{
'user-select': dragging ? 'none' : null,
}"
class="swipe-frame"
>
<image-viewer
key="swipeOldImg"
ref="swipeOldImg"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment