@edu-tosel/design 1.0.333 → 1.0.335

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.333",
3
+ "version": "1.0.335",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.333
1
+ 1.0.335
@@ -47,9 +47,18 @@ export default function SelectLG({ state, selectOptions: selectOptionsInput, pla
47
47
  }
48
48
  };
49
49
  useEffect(() => {
50
- const responses = selectOptions?.filter(({ title }) => title?.includes(search));
51
- setFilteredOptions(responses);
52
- }, [search, selectOptions]); // selectOptions 추가
50
+ if (!selectOptions)
51
+ return;
52
+ // 검색어가 없으면 전체 옵션 표시
53
+ if (!search) {
54
+ setFilteredOptions(selectOptions);
55
+ }
56
+ else {
57
+ // 검색어가 있으면 필터링된 옵션 표시
58
+ const responses = selectOptions.filter(({ title }) => title?.includes(search));
59
+ setFilteredOptions(responses);
60
+ }
61
+ }, [search, selectOptions?.length]);
53
62
  useEffect(() => {
54
63
  if (typeof index === "number" && itemRefs.current[index]) {
55
64
  itemRefs.current[index]?.scrollIntoView({ block: "nearest" });