moveable icon indicating copy to clipboard operation
moveable copied to clipboard

Uncaught TypeError: Cannot set properties of null (setting 'dist')

Open d2461379109 opened this issue 8 months ago • 4 comments

Environments

  • Framework name: vue3-moveable
  • Framework version: 0.26.1
  • Moveable Component version: 0.51.1
  • Testable Address(optional):

Description

When the keyboard request function attempts to move the element, the keyboard does not release, switches the selected element, and the console reports this error. But I want the new element to move after I switch the selection element.

I printed a log in the unset method in the source code and found that calling unset a setTimeout asynchronous.

image

d2461379109 avatar Dec 01 '23 08:12 d2461379109

@daybrush

d2461379109 avatar Dec 01 '23 08:12 d2461379109

@d2461379109

Could you tell me the code of how you used the request method with the keyboard event?

daybrush avatar Dec 01 '23 16:12 daybrush

@d2461379109

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

  • -Yes, that's OK, thanks!

d2461379109 avatar Dec 04 '23 11:12 d2461379109