We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我们仅讨论拖动普通元素时的dataTransfer对象
dataTransfer
该属性需要在dragstart中设置,不过需要注意的是,如果不设置该属性,它并不总是为all或uninitialized
dragstart
all
uninitialized
如果可以,请始终设置且不要设置成all,设置成具体的如copyMove兼容性会更好
copyMove
该属性仅可设置effectAllowed指定的值,该属性会影响鼠标样式的展现
effectAllowed
如果设置该属性不生效,请检查effectAllowed是不是不包含你设置的值或effectAllowed已经是none了
none
另外需要注意的是,在拖动过程中某些键盘按键会导致effectAllowed变化,比如mac下的metaKey会影响effectAllowed
mac
metaKey
我们可以这样解决
a. 在dragover中检测effectAllowed的变化 b. 如果effectAllowed有变化,我们在当前节点派发dragleave再派发dragenter事件 c. 在drop事件中检测dropEffect来决定对本次拖动是否生效
dragover
dragleave
dragenter
drop
dropEffect
The text was updated successfully, but these errors were encountered:
No branches or pull requests
effectAllowed
该属性需要在
dragstart
中设置,不过需要注意的是,如果不设置该属性,它并不总是为all
或uninitialized
如果可以,请始终设置且不要设置成
all
,设置成具体的如copyMove
兼容性会更好dropEffect
该属性仅可设置
effectAllowed
指定的值,该属性会影响鼠标样式的展现如果设置该属性不生效,请检查
effectAllowed
是不是不包含你设置的值或effectAllowed
已经是none
了另外需要注意的是,在拖动过程中某些键盘按键会导致
effectAllowed
变化,比如mac
下的metaKey
会影响effectAllowed
我们可以这样解决
a. 在
dragover
中检测effectAllowed
的变化b. 如果
effectAllowed
有变化,我们在当前节点派发dragleave
再派发dragenter
事件c. 在
drop
事件中检测dropEffect
来决定对本次拖动是否生效The text was updated successfully, but these errors were encountered: