@jiujue/react-canvas-fiber 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1538,9 +1538,7 @@ function createCanvasRoot(canvas, options) {
1538
1538
  stopPicker() {
1539
1539
  if (!this.picker.enabled) return;
1540
1540
  this.picker.enabled = false;
1541
- this.picker.rootInstanceId = null;
1542
1541
  this.picker.hoverId = null;
1543
- this.picker.selectedId = null;
1544
1542
  this.pickerCleanup?.();
1545
1543
  this.pickerCleanup = null;
1546
1544
  },
@@ -1550,7 +1548,12 @@ function createCanvasRoot(canvas, options) {
1550
1548
  unregisterRoot(id) {
1551
1549
  const handle = this.roots.get(id);
1552
1550
  if (!handle) return;
1553
- if (this.picker.rootInstanceId === id) this.stopPicker();
1551
+ if (this.picker.rootInstanceId === id) {
1552
+ if (this.picker.enabled) this.stopPicker();
1553
+ this.picker.rootInstanceId = null;
1554
+ this.picker.hoverId = null;
1555
+ this.picker.selectedId = null;
1556
+ }
1554
1557
  handle.unsubscribe?.();
1555
1558
  this.roots.delete(id);
1556
1559
  }