Skip to content

Commit

Permalink
Allow combobox autocomplete passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjacob committed Jan 31, 2025
1 parent 16d561d commit e4620e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-pagoda/ui",
"version": "3.1.4",
"version": "3.1.5",
"description": "A React component library that implements the official NEAR design system.",
"license": "MIT",
"repository": {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { CaretDown, CheckCircle, Circle } from '@phosphor-icons/react';
import { useCombobox } from 'downshift';
import type { CSSProperties, FocusEventHandler, ReactElement } from 'react';
import type { CSSProperties, FocusEventHandler, HTMLInputAutoCompleteAttribute, ReactElement } from 'react';
import { useMemo, useRef } from 'react';
import { forwardRef } from 'react';
import { useEffect } from 'react';
Expand All @@ -22,6 +22,7 @@ export type ComboboxOption = {
};

type BaseProps = {
autoComplete?: HTMLInputAutoCompleteAttribute; // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
allowCustomInput?: boolean;
allowNone?: boolean;
assistive?: string;
Expand Down Expand Up @@ -194,6 +195,7 @@ export const Combobox = forwardRef<HTMLInputElement, Props>(
label={props.label}
name={props.name}
number={props.number}
autoComplete={props.autoComplete}
onBlur={onBlur}
onClick={() => {}} // Ignore this library change: https://github.com/downshift-js/downshift/blob/master/src/hooks/MIGRATION_V8.md#usecombobox-input-click
onFocus={onFocus}
Expand Down

0 comments on commit e4620e4

Please sign in to comment.