mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-14 20:21:23 +08:00
fix(skills): guard empty options array in Dropdown example
This commit is contained in:
@@ -257,6 +257,8 @@ export function Dropdown({ options, onSelect }: { options: string[]; onSelect: (
|
|||||||
const [activeIndex, setActiveIndex] = useState(0);
|
const [activeIndex, setActiveIndex] = useState(0);
|
||||||
const listId = useId();
|
const listId = useId();
|
||||||
|
|
||||||
|
if (!options.length) return null;
|
||||||
|
|
||||||
const handleKeyDown = (e: React.KeyboardEvent) => {
|
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
case 'ArrowDown':
|
case 'ArrowDown':
|
||||||
|
|||||||
Reference in New Issue
Block a user