mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
UserPicker: Use clearable AsyncSelect for the UserPicker (#27994)
This commit is contained in:
parent
dfe04ea3e8
commit
6173aa70b7
@ -3,8 +3,7 @@ import React, { Component } from 'react';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import { LegacyForms } from '@grafana/ui';
|
import { AsyncSelect } from '@grafana/ui';
|
||||||
const { AsyncSelect } = LegacyForms;
|
|
||||||
|
|
||||||
// Utils & Services
|
// Utils & Services
|
||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
@ -66,13 +65,14 @@ export class UserPicker extends Component<Props, State> {
|
|||||||
return (
|
return (
|
||||||
<div className="user-picker" data-testid="userPicker">
|
<div className="user-picker" data-testid="userPicker">
|
||||||
<AsyncSelect
|
<AsyncSelect
|
||||||
|
isClearable
|
||||||
className={className}
|
className={className}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
defaultOptions={true}
|
defaultOptions={true}
|
||||||
loadOptions={this.debouncedSearch}
|
loadOptions={this.debouncedSearch}
|
||||||
onChange={onSelected}
|
onChange={onSelected}
|
||||||
placeholder="Select user"
|
placeholder="Select user"
|
||||||
noOptionsMessage={() => 'No users found'}
|
noOptionsMessage="No users found"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user