@edu-tosel/design 1.0.333 → 1.0.334

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.334",
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.334
@@ -47,9 +47,16 @@ 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
+ if (search === "") {
53
+ setFilteredOptions(selectOptions);
54
+ }
55
+ else {
56
+ const responses = selectOptions.filter(({ title }) => title?.includes(search));
57
+ setFilteredOptions(responses);
58
+ }
59
+ }, [search, selectOptions?.length]);
53
60
  useEffect(() => {
54
61
  if (typeof index === "number" && itemRefs.current[index]) {
55
62
  itemRefs.current[index]?.scrollIntoView({ block: "nearest" });