一部のアプリからファイルを投稿フォームへドロップできない場合がある問題を修正 (#9035)

* dropEffectとeffectAllowedの関連付けを修正

* Update Changelog

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
hayabusa
2022-07-25 21:16:11 +09:00
committed by GitHub
parent f835421d70
commit 36f083c189
2 changed files with 17 additions and 1 deletions

View File

@ -479,7 +479,22 @@ function onDragover(ev) {
if (isFile || isDriveFile) {
ev.preventDefault();
draghover = true;
ev.dataTransfer.dropEffect = ev.dataTransfer.effectAllowed === 'all' ? 'copy' : 'move';
switch (ev.dataTransfer.effectAllowed) {
case 'all':
case 'uninitialized':
case 'copy':
case 'copyLink':
case 'copyMove':
ev.dataTransfer.dropEffect = 'copy';
break;
case 'linkMove':
case 'move':
ev.dataTransfer.dropEffect = 'move';
break;
default:
ev.dataTransfer.dropEffect = 'none';
break;
}
}
}