[test] prevent contextmenu when only polyfilled
This commit is contained in:
@@ -312,6 +312,14 @@
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const preventIfPolyfilled = (e:Event) => {
|
||||||
|
if(globalThis.polyfilledDragDrop){
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onDestroy(unsub);
|
onDestroy(unsub);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -348,7 +356,7 @@
|
|||||||
on:dragover={avatarDragOver}
|
on:dragover={avatarDragOver}
|
||||||
on:drop={(e) => {avatarDrop({index:ind}, e)}}
|
on:drop={(e) => {avatarDrop({index:ind}, e)}}
|
||||||
on:dragenter={preventAll}
|
on:dragenter={preventAll}
|
||||||
on:contextmenu={preventAll}
|
on:contextmenu={preventIfPolyfilled}
|
||||||
>
|
>
|
||||||
<SidebarIndicator
|
<SidebarIndicator
|
||||||
isActive={char.type === 'normal' && $selectedCharID === char.index && sideBarMode !== 1}
|
isActive={char.type === 'normal' && $selectedCharID === char.index && sideBarMode !== 1}
|
||||||
@@ -417,7 +425,7 @@
|
|||||||
on:dragover={avatarDragOver}
|
on:dragover={avatarDragOver}
|
||||||
on:drop={(e) => {if(char.type === 'folder'){avatarDrop({index: ind, folder:char.id}, e)}}}
|
on:drop={(e) => {if(char.type === 'folder'){avatarDrop({index: ind, folder:char.id}, e)}}}
|
||||||
on:dragenter={preventAll}
|
on:dragenter={preventAll}
|
||||||
on:contextmenu={preventAll}
|
on:contextmenu={preventIfPolyfilled}
|
||||||
>
|
>
|
||||||
<SidebarIndicator
|
<SidebarIndicator
|
||||||
isActive={$selectedCharID === char2.index && sideBarMode !== 1}
|
isActive={$selectedCharID === char2.index && sideBarMode !== 1}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export function polyfill() {
|
|||||||
|
|
||||||
if((!supports) || isIos){
|
if((!supports) || isIos){
|
||||||
console.log('polyfiled dragdrop')
|
console.log('polyfiled dragdrop')
|
||||||
|
globalThis.polyfilledDragDrop = true
|
||||||
dragPolyfill({
|
dragPolyfill({
|
||||||
// use this to make use of the scroll behaviour
|
// use this to make use of the scroll behaviour
|
||||||
dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride,
|
dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride,
|
||||||
|
|||||||
Reference in New Issue
Block a user