packages/react/src/hooks/useTypeahead.ts
Function useTypeahead
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useTypeahead<RT extends ReferenceType = ReferenceType>(
context: FloatingContext<RT>,
props: UseTypeaheadProps,
): ElementProps {
const {open, dataRef} = context;
- Create a ticketCreate a ticket
Function onKeyDown
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onKeyDown(event: React.KeyboardEvent) {
const listContent = listRef.current;
if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {
if (
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
Open
if (
listContent == null ||
ignoreKeysRef.current.includes(event.key) ||
// Character key.
event.key.length !== 1 ||
- Create a ticketCreate a ticket