fix(skills): guard empty options array in Dropdown example

This commit is contained in:
hjkim0905
2026-05-25 00:14:19 +09:00
parent 85b4114248
commit 4e4ccebacb

View File

@@ -257,6 +257,8 @@ export function Dropdown({ options, onSelect }: { options: string[]; onSelect: (
const [activeIndex, setActiveIndex] = useState(0);
const listId = useId();
if (!options.length) return null;
const handleKeyDown = (e: React.KeyboardEvent) => {
switch (e.key) {
case 'ArrowDown':