dragula icon indicating copy to clipboard operation
dragula copied to clipboard

TypeError: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite.

Open eJunior08 opened this issue 6 years ago • 11 comments

When I'm dragging my element and this element has changed on Firebase (while I still on drag) the element is copied. So Im trying to use dragula.destroy('my-bag'); but I have the above error. I also have this error: TypeError: Cannot read property 'drake' of undefined.

My HTML:

<div class="col column-card" id="fila"  [style.height.px]="heightPage" [dragula]='"fila"' [dragulaOptions]="options">
...
</div>

My TS:

public itemsRef: AngularFireList<any>;
public items: Observable<any[]>;

constructor(
    db: AngularFireDatabase,
    private dragula: DragulaService,
  ) {

    this.itemsRef = db.list('CardPosition');

    this.items = this.itemsRef.snapshotChanges().map((changes) => {
      if (someChange()) {
        this.dragula.destroy('fila');
      }
      return changes.map((c) => ({ key: c.payload.key, ...c.payload.val() }));
    });

}

eJunior08 avatar May 24 '18 19:05 eJunior08

I have somewhat the same issue. Did you find a solution for the problem?

I also have a firebase integration, but I don't think it's related to that, as I don't use firebase in my dropModel. When I have a listener on the dropModel, and try to destroy the group in the listener, I get the same: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite.

LanderBeeuwsaert avatar Jul 22 '18 08:07 LanderBeeuwsaert

Same for me

miki995 avatar Oct 25 '18 09:10 miki995

the same issue

volser avatar Dec 17 '18 11:12 volser

Hello Team, I have the same issue. I use formio which use your lib to drag n drop component.

Did you have a solution please :) See you

Romakita avatar Aug 27 '19 07:08 Romakita

From what I understand from the documentation, you should call the destroy, without any arguments, on the dragula instance.

E.g.

this.drake = dragula([container]);
myDestroyFunction = () => {
  this.drake.destroy();
}

paddotk avatar Sep 12 '19 12:09 paddotk

Hello Team, I have the same issue. I use formio which use your lib to drag n drop component.

Did you have a solution please :) See you

Hey @Romakita Did you find anything about this. I am using formio. And I am getting the same error.

narinderNutrien avatar Oct 26 '19 21:10 narinderNutrien

@narinderNutrien The problem doesn't come from dragula itself. The react-formio doesn't use correctly dragula. It remove the FormBuilder instance (and dragula instance), during the dragndrop because something change in the react state. Because the original element is destroyed, the dragndrop failed, and dragula isn't able to find the original element.

So finally I forked the react-formio lib a rewritten the react component to fix this problem. The react-formio isn't stable (dragndrop and saving problem) because formiojs isn't correctly binded with react.

Here the code: https://gist.github.com/Romakita/16d8881fd991485d3b4d9afa646ccae1

See you Romain

Romakita avatar Nov 04 '19 07:11 Romakita

im having the same problem:

TypeError: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite.

i have the Chrome Dev tools open, don't know if that has anything to do with it

[edit] it had to do with the DOM not showing my html any more, solved it

robvaneck avatar Mar 18 '20 12:03 robvaneck

Any update?

rahulkanneri avatar Jun 17 '20 05:06 rahulkanneri

My workaround for this is to update the reset_actions function in action_chains.py file which is located in C:\Users\user\Envs\virtual_env_here\Lib\site-packages\selenium\webdriver\common\action_chains.py (in my case it is located here and I am using virtualenv by the way).

FROM

def reset_actions(self):
        """
            Clears actions that are already stored locally and on the remote end
        """
        if self._driver.w3c:
            self.w3c_actions.clear_actions()
        self._actions = []

TO

def reset_actions(self):
        """
            Clears actions that are already stored locally and on the remote end
        """
        if self._driver.w3c:
            self.w3c_actions.clear_actions()
            for device in self.w3c_actions.devices:
                device.clear_actions()
        self._actions = []

Added these two lines:

for device in self.w3c_actions.devices:
                device.clear_actions()

marisaq2016 avatar Sep 09 '20 06:09 marisaq2016

hey all, if anyone is still watching this I am testing and trying to get this to work again.

This appears to be a potential bug in the destroy() functionality

dcantatore avatar Sep 28 '20 19:09 dcantatore