selecto icon indicating copy to clipboard operation
selecto copied to clipboard

Issue with destroy - Cannot read properties of null (reading 'unset')

Open adela-almasan opened this issue 3 years ago • 1 comments

Environments

  • Framework name: React
  • Framework version: 17.0.2
  • Component name: Selecto (+Moveable)
  • Component version: 1.19.1

Description

Hi! I'm having an issue when trying to destroy Selecto - as part of allowing/not allowing interactions. This is how I'm using it - Selecto is defined in all cases, so not sure about gesto.

if (inlineEditingSwitched && this.props.options.inlineEditing) {
    this.scene.selecto?.destroy();
}

Screen Shot 2022-09-14 at 4 12 47 PM

Screen Shot 2022-09-14 at 4 13 11 PM

I'm still investigating on our end, but was wondering if you might have any ideas.

adela-almasan avatar Sep 14 '22 21:09 adela-almasan

@adela-almasan

I think destroy is called destroy 2 times. after calling destroy try setting this.scene.selecto = null;

daybrush avatar Sep 15 '22 00:09 daybrush