daybrush / selecto

Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.
https://daybrush.com/selecto
MIT License
2.04k stars 82 forks source link

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

Closed adela-almasan closed 1 year ago

adela-almasan commented 1 year ago

Environments

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.

daybrush commented 1 year ago

@adela-almasan

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