@revisium/schema-toolkit-ui 0.2.0 → 0.2.1

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.cjs CHANGED
@@ -1409,6 +1409,7 @@ var CollapseManager = class {
1409
1409
  var KeyboardNavigation = class {
1410
1410
  _mode = "TREE_NAV";
1411
1411
  _skipNextEscape = false;
1412
+ _suppressNextReturnFocus = false;
1412
1413
  _containerRef = null;
1413
1414
  _disposers = [];
1414
1415
  constructor(_treeState, _navigator, _accessors) {
@@ -1425,7 +1426,8 @@ var KeyboardNavigation = class {
1425
1426
  if (!isFocused && wasFocused) {
1426
1427
  this._mode = "TREE_NAV";
1427
1428
  this._skipNextEscape = true;
1428
- this.deferReturnFocus();
1429
+ if (this._suppressNextReturnFocus) this._suppressNextReturnFocus = false;
1430
+ else this.deferReturnFocus();
1429
1431
  }
1430
1432
  }));
1431
1433
  }
@@ -1506,10 +1508,12 @@ var KeyboardNavigation = class {
1506
1508
  const target = event.target;
1507
1509
  if (!(target instanceof HTMLElement)) return;
1508
1510
  if (this._containerRef?.contains(target)) {
1511
+ this._suppressNextReturnFocus = true;
1509
1512
  if (!target.closest("[data-node-id]")) this._treeState.setActiveNodeId(null);
1510
1513
  return;
1511
1514
  }
1512
- if (!target.closest("[role=\"menu\"], [role=\"listbox\"], [role=\"dialog\"]")) this._treeState.setActiveNodeId(null);
1515
+ if (target.closest("[role=\"menu\"], [role=\"listbox\"], [role=\"dialog\"]")) this._suppressNextReturnFocus = true;
1516
+ else this._treeState.setActiveNodeId(null);
1513
1517
  };
1514
1518
  handleEditEnter() {
1515
1519
  this.insertField();