-
mergeRefs(input as HTMLInputElement)}
- onChange={(e) => handleEmailChange(e)}
- aria-expanded={isOpen}
- value={email}
- type="text"
- role="combobox"
- autoComplete="off"
- aria-autocomplete="list"
- aria-invalid={isInvalid}
- {...(isOpen ? { 'aria-controls': listId } : {})}
- {...getClasses(Elements.Input)}
- {...getEvents()}
- />
- {isOpen && (
-
- {suggestions.map((domain, i) => (
- - (liRefs.current[i] = li)}
- onPointerMove={() => setActiveSuggestion(-1, i)}
- onMouseMove={() => setActiveSuggestion(-1, i)}
- onPointerLeave={() => setActiveSuggestion(-1, -1)}
- onMouseLeave={() => setActiveSuggestion(-1, -1)}
- onClick={(e) => handleSelect(e, i, { isKeyboard: false, isInput: false })}
- onKeyDown={handleListKeyDown}
- key={domain}
- aria-posinset={i + 1}
- aria-setsize={suggestions.length}
- aria-selected={i === activeSuggestion.focusedIndex}
- tabIndex={-1}
- {...getClasses(Elements.Suggestion)}
- {...{
- [activeDataAttr ? activeDataAttr : 'data-active-email']: i === activeSuggestion.hoveredIndex,
- }}
- >
- {username}
- @{domain}
-
- ))}
-
- )}
- {children}
-
- )
- }
-)
-
-Email.displayName = 'Email'
+import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
+import {
+ cleanValue,
+ getUniqueId,
+ getHonestValue,
+ isFn,
+ useIsomorphicLayoutEffect,
+ alphanumericKeys,
+ getEmailData,
+ getScrollElement
+} from './utils';
+import {
+ Events,
+ OnSelectData,
+ Elements,
+ Maybe,
+ Email as Export,
+ EmailProps,
+ Placement
+} from './types';
+
+export const Email: typeof Export = forwardRef