moveable icon indicating copy to clipboard operation
moveable copied to clipboard

moveable.esm.js:2980 Uncaught TypeError: Cannot set properties of null (setting 'dist')

Open hqiaozhang opened this issue 2 years ago • 5 comments

Environments

  • Framework name:
  • Framework version:
  • Moveable Component version:
  • Testable Address(optional):

Description

报错moveable.esm.js:2980 Uncaught TypeError: Cannot set properties of null (setting 'dist')是什么意思

hqiaozhang avatar Nov 26 '23 06:11 hqiaozhang

@hqiaozhang

Can I know when it happens?

daybrush avatar Nov 26 '23 07:11 daybrush

没有规律,就有时候点着点着就报这个错了 @daybrush

hqiaozhang avatar Dec 01 '23 02:12 hqiaozhang

I had the same problem. When the keyboard request function moves the element, the keyboard does not mouseup, switches the selected element, and the console reports this error. But I want the new element to be able to move after switching the selection element. @daybrush

d2461379109 avatar Dec 01 '23 07:12 d2461379109

@hqiaozhang

I would like to know the moveable usage code at the time the error call stack occurred.

Does the target change when clicked or something like that? Would you like to wait for the target to change and try it? (.waitToChangeTarget)

// setTargets("???")
targetsRef.current = [];

// next call request
moveable.waitToChangeTarget().then(() => {
   moveable.request(...);
 });

daybrush avatar Dec 03 '23 10:12 daybrush

image 我开始点击产品报价那个元素移动了一下,然后又点击到了订单回款这个元素,就报Cannot set properties of null (setting 'dist')错误了 @daybrush

hqiaozhang avatar Dec 04 '23 07:12 hqiaozhang