@sayknow-cli/tui 0.3.9 → 0.3.10

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@sayknow-cli/tui",
4
- "version": "0.3.9",
4
+ "version": "0.3.10",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://sayknow-cli.com",
7
7
  "author": "jaybeyond",
@@ -38,8 +38,8 @@
38
38
  "fmt": "biome format --write ."
39
39
  },
40
40
  "dependencies": {
41
- "@sayknow-cli/natives": "0.3.9",
42
- "@sayknow-cli/utils": "0.3.9",
41
+ "@sayknow-cli/natives": "0.3.10",
42
+ "@sayknow-cli/utils": "0.3.10",
43
43
  "lru-cache": "11.3.6",
44
44
  "marked": "^18.0.3"
45
45
  },
@@ -213,11 +213,9 @@ export class SettingsList implements Component {
213
213
 
214
214
  #closeSubmenu(): void {
215
215
  this.#submenuComponent = null;
216
- // Restore selection to the item that opened the submenu, clamped against
217
- // the current list because callers may replace items while the submenu is open.
216
+ // Restore selection to the item that opened the submenu
218
217
  if (this.#submenuItemIndex !== null) {
219
- this.#selectedIndex =
220
- this.#items.length === 0 ? 0 : Math.min(this.#submenuItemIndex, Math.max(0, this.#items.length - 1));
218
+ this.#selectedIndex = this.#submenuItemIndex;
221
219
  this.#submenuItemIndex = null;
222
220
  this.#notifySelectionChange();
223
221
  }