Live video on the AT Protocol

Merge pull request #706 from streamplace/natb/handle-autocomplete

fix: autocomplete handle/emoji selection with tab

authored by

natalie and committed by
GitHub
08b7b53b 26896cfe

+13
+13
js/components/src/components/chat/chat-box.tsx
··· 354 354 k.preventDefault(); 355 355 submit(); 356 356 } 357 + } else if (k.nativeEvent.key === "Tab") { 358 + if (showSuggestions) { 359 + k.preventDefault(); 360 + const handles = Array.from(filteredAuthors.keys()); 361 + if (handles.length > 0) { 362 + handleMentionSelect(handles[highlightedIndex]); 363 + } 364 + } else if (showEmojiSuggestions) { 365 + k.preventDefault(); 366 + if (filteredEmojis.length > 0) { 367 + handleEmojiSelect(filteredEmojis[highlightedIndex]); 368 + } 369 + } 357 370 } else if (k.nativeEvent.key === "ArrowUp") { 358 371 if (showSuggestions || showEmojiSuggestions) { 359 372 k.preventDefault();