(e: React.KeyboardEvent<HTMLInputElement>)
| 95 | |
| 96 | // Handle keyboard events for navigating and selecting suggestions |
| 97 | const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => { |
| 98 | if (e.key === 'Enter' && focusedIndex >= 0 && suggestedDomains.length > 0) { |
| 99 | handleSuggestionClick(suggestedDomains[focusedIndex]); |
| 100 | } else if (e.key === 'ArrowDown') { |
| 101 | e.preventDefault(); |
| 102 | setFocusedIndex((prevIndex) => |
| 103 | Math.min(prevIndex + 1, suggestedDomains.length - 1), |
| 104 | ); |
| 105 | } else if (e.key === 'ArrowUp') { |
| 106 | e.preventDefault(); |
| 107 | setFocusedIndex((prevIndex) => Math.max(prevIndex - 1, 0)); |
| 108 | } |
| 109 | }; |
| 110 | |
| 111 | const handleSubmit = async (e?: React.FormEvent<HTMLButtonElement>) => { |
| 112 | const loadId = toast.loading('Signing in...'); |
nothing calls this directly
no test coverage detected