Prevent drag event to interfere with input elements in Firefox using HTML5 drag/drop

前端 未结 5 1271
猫巷女王i
猫巷女王i 2020-12-18 22:56

It seems that an input element loses a lot of functionality when put into an element with draggable=\"true\". This only seems to occur in firefox.

See my jsfiddle: h

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 23:31

    I used the onMouseEnter and onMouseLeave functions on the textarea to set the div draggable only when the mouse is outside the textarea.

    I did this because I needed the focus to stay in the edit fields while dragging and dragging itself does not trigger a focus event.

提交回复
热议问题