Autofocus shelf owner search if empty
This commit is contained in:
parent
45b0dd6ffe
commit
3d6666cc40
|
@ -25,7 +25,7 @@ const memberSorts = {
|
|||
};
|
||||
|
||||
export function MembersDropdown(props) {
|
||||
const { token, name, onChange, value, initial } = props;
|
||||
const { token, name, onChange, value, initial, autofocus } = props;
|
||||
const [response, setResponse] = useState({ results: [] });
|
||||
const searchDefault = {seq: 0, q: initial || '', sort: 'newest_active'};
|
||||
const [search, setSearch] = useState(searchDefault);
|
||||
|
@ -61,6 +61,9 @@ export function MembersDropdown(props) {
|
|||
placeholder='Search for Member'
|
||||
onChange={onChange}
|
||||
onSearchChange={(e, v) => setSearch({seq: parseInt(e.timeStamp), q: v.searchQuery, sort: 'newest_active'})}
|
||||
|
||||
searchInput={{ autoFocus: autofocus }}
|
||||
openOnFocus={!autofocus}
|
||||
/>
|
||||
|
||||
);
|
||||
|
|
|
@ -33,6 +33,7 @@ export function StorageEditor(props) {
|
|||
{...makeProps('member_id')}
|
||||
onChange={handleValues}
|
||||
initial={input.member_name}
|
||||
autofocus={!input.member_name}
|
||||
/>
|
||||
</Form.Field>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user