angular-drag-and-drop-lists icon indicating copy to clipboard operation
angular-drag-and-drop-lists copied to clipboard

Cannot enter value into input[text] on Safari 9 when it has the dnd-nodrag directive

Open jisuo opened this issue 10 years ago • 6 comments

Using: Safari Version 9.0 (11601.1.56) OS X 10.11 (have not tested on other safari versions)

Example fiddle: http://jsfiddle.net/63qvw2kp/1/

Can sometimes just enter a single character. Sometimes none.

jisuo avatar Oct 06 '15 16:10 jisuo

Seems like click events are not propagated to input field too.

Same situation is with Firefox 41.01 on Mac.

rastasheep avatar Oct 09 '15 10:10 rastasheep

This caused by default css styles in Safari for draggable input elements (input is draggable but it's 'stubbed' to do nothing => same effect as not draggable).

To fix this just add a css like:

input[draggable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

http://stackoverflow.com/questions/32192686/cannot-type-in-password-field-with-draggable-true-in-safari

Firefox problem is more dificult, it's a bug in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=800050 https://bugzilla.mozilla.org/show_bug.cgi?id=1189486

rastasheep avatar Oct 12 '15 22:10 rastasheep

@marceljuenemann Has this task been fixed?

FrankBright avatar Nov 30 '16 01:11 FrankBright

@rastasheep doesn't work for me, did you test it ?

FrankBright avatar Nov 30 '16 01:11 FrankBright

Thanks to the others for the hints, that's how I did it.

<ul class='task-list-wrapper'
    dnd-inserted="$ctrl.updateTaskList($ctrl.dragOrigin, index)"
    dnd-list="$ctrl.parent.childrenTasks">
  <li ng-repeat="task in $ctrl.parent.childrenTasks"
      class="tb-drag-parent"
      dnd-disable-if="!task.draggable"
      dnd-dragstart="$ctrl.dragOrigin = $index"
      dnd-draggable="task">
    
    <task-drag-handle ng-mouseenter="task.draggable = true" ng-mouseleave="task.draggable = false"></task-drag-handle>
    
    <div class="removable">
      <i ng-show="$ctrl.settings.isEditable"
         class="fa fa-remove remove-icon top-left"
         ng-click="$ctrl.deleteTaskFromParentByIndex($index, $ctrl.parent)"></i>
      <taskk task="task" settings="$ctrl.settings"></taskk>
    </div>
    
  </li>
  <spinner center="true" size="35" ng-if="$ctrl.loading"></spinner>
</ul>

Works, the code is in use. Important note: Won't work when you have a dnd-nodrag inside of the li! However, with this code, you won't need a dnd-nodrag anymore. This solved two issues for me: 1st the input is clickable again in Firefox and IE, second, the text is highlightable again in all browsers!

bersling avatar Dec 17 '16 19:12 bersling

I posted something that may help with this issue here

Goddak avatar Oct 11 '17 14:10 Goddak