Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{filteredData.map((datum, i) => {
const resultId = getResultId(suggestionsId, i);
let optionProps: ListboxOptionProps | undefined;
if (isListboxOptionProps(datum)) {
optionProps = omit(datum, [labelKey, valueKey]);
}
return (
<option selected="{false}" id="{resultId}"> handleAutoComplete(i)}
>
{getResultLabel(datum, labelKey, value)}
</option>
const ButtonWithTooltip: FunctionComponent = ({
children,
...props
}) => {
const buttonProps = omit(props, [
"tooltip",
"tooltipId",
"dense",
"hoverDelay",
"focusDelay",
"vhMargin",
"vwMargin",
"spacing",
"denseSpacing",
"defaultVisible",
"defaultPosition",
]);
return (
{({ tooltip, containerProps }) => (
{options.map((option, i) => {
const optionId = getOptionId(id, i);
const optionValue = getOptionValue(option, valueKey);
const optionLabel = getOptionLabel(option, labelKey);
let optionProps: ListboxOptionProps | undefined;
if (isListboxOptionProps(option)) {
optionProps = omit(option, [labelKey, valueKey]);
}
const disabled = isOptionDisabled(option);
let onClick;
if (!readOnly && !disabled) {
onClick = () => {
handleChange(i);
setFocusedIndex(i);
};
}
return (
const { key } = event;
const isSpace = key === " ";
if (isSpace || key === "Enter") {
if (isSpace) {
event.preventDefault();
}
event.currentTarget.click();
}
}
return (
<div tabindex="{disabled" aria-disabled="{disabled">
{children}
</div>
);
};