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

前端 未结 5 1280
猫巷女王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:43

    I have also found using onmouseenter and onmouseleave to toggle the draggable attribute works better because it places the cursor in the input box where you actually click. When using onfocus/onblur, the cursor always goes to the start or end of the text even if you click in the middle.

提交回复
热议问题