tabIndex on dropdown (#3532)

This commit is contained in:
Jaco Greeff 2020-08-26 21:18:15 +02:00 committed by GitHub
parent 40c4145a27
commit a2c3c6a121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -336,6 +336,7 @@ function Create ({ className = '', onClose, onStatusChange, seed: propsSeed, typ
label={t<string>('keypair crypto type')}
onChange={_onChangePairType}
options={uiSettings.availableCryptos}
tabIndex={-1}
/>
</Modal.Column>
<Modal.Column>
@ -359,6 +360,7 @@ function Create ({ className = '', onClose, onStatusChange, seed: propsSeed, typ
? t<string>('//hard/soft///password')
: t<string>('//hard///password')
}
tabIndex={-1}
value={derivePath}
/>
{deriveError && (

View File

@ -33,6 +33,7 @@ interface Props<Option> {
placeholder?: string;
renderLabel?: (item: any) => any;
searchInput?: { autoFocus: boolean };
tabIndex?: number;
transform?: (value: any) => any;
value?: any;
withEllipsis?: boolean;
@ -43,7 +44,7 @@ export type IDropdown<Option> = React.ComponentType<Props<Option>> & {
Header: React.ComponentType<{ content: React.ReactNode }>;
}
function BaseDropdown<Option> ({ allowAdd = false, className = '', defaultValue, dropdownClassName, help, isButton, isDisabled, isError, isFull, isMultiple, label, labelExtra, onAdd, onBlur, onChange, onClose, onSearch, options, placeholder, renderLabel, searchInput, transform, value, withEllipsis, withLabel }: Props<Option>): React.ReactElement<Props<Option>> {
function BaseDropdown<Option> ({ allowAdd = false, className = '', defaultValue, dropdownClassName, help, isButton, isDisabled, isError, isFull, isMultiple, label, labelExtra, onAdd, onBlur, onChange, onClose, onSearch, options, placeholder, renderLabel, searchInput, tabIndex, transform, value, withEllipsis, withLabel }: Props<Option>): React.ReactElement<Props<Option>> {
const lastUpdate = useRef<string>('');
const [stored, setStored] = useState<string | undefined>();
@ -102,6 +103,7 @@ function BaseDropdown<Option> ({ allowAdd = false, className = '', defaultValue,
search={onSearch || allowAdd}
searchInput={searchInput}
selection
tabIndex={tabIndex}
value={stored}
/>
);