sh-ui-cli 0.58.0 → 0.58.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.
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$description": "sh-ui 릴리즈 노트 단일 소스. docs(React)와 showcase(Flutter)가 함께 읽는다. 새 릴리즈마다 맨 앞에 추가.",
|
|
4
4
|
"versions": [
|
|
5
|
+
{
|
|
6
|
+
"version": "0.58.1",
|
|
7
|
+
"date": "2026-05-06",
|
|
8
|
+
"title": "fix — Sidebar focus trap 의 TS strict 위반 (firstEl/lastEl possibly undefined)",
|
|
9
|
+
"type": "patch",
|
|
10
|
+
"highlights": [
|
|
11
|
+
"**Sidebar `useFocusTrap` 의 TS strict 위반 해소** — `items.length === 0` 가드 후에도 `items[0]` / `items[items.length - 1]` 가 `possibly undefined` 로 잡혀 사용자 프로젝트 (strict tsconfig) 에서 typecheck 실패하던 문제. 가드를 `firstEl`/`lastEl` 직접 null-check 로 재구성 — 동작 동일, TS 만족. 사용자가 sh-ui Sidebar 컴포넌트를 add 후 본인 프로젝트에서 `tsc --noEmit` 돌릴 때 막히던 케이스 해소."
|
|
12
|
+
],
|
|
13
|
+
"url": "https://github.com/sanghyeonKim0201/sh-ui/releases/tag/v0.58.1"
|
|
14
|
+
},
|
|
5
15
|
{
|
|
6
16
|
"version": "0.58.0",
|
|
7
17
|
"date": "2026-05-05",
|
|
@@ -51,12 +51,12 @@ function useFocusTrap(
|
|
|
51
51
|
}
|
|
52
52
|
if (e.key !== "Tab") return;
|
|
53
53
|
const items = focusables();
|
|
54
|
-
|
|
54
|
+
const firstEl = items[0];
|
|
55
|
+
const lastEl = items[items.length - 1];
|
|
56
|
+
if (!firstEl || !lastEl) {
|
|
55
57
|
e.preventDefault();
|
|
56
58
|
return;
|
|
57
59
|
}
|
|
58
|
-
const firstEl = items[0];
|
|
59
|
-
const lastEl = items[items.length - 1];
|
|
60
60
|
if (e.shiftKey && document.activeElement === firstEl) {
|
|
61
61
|
e.preventDefault();
|
|
62
62
|
lastEl.focus();
|