[User Experience] Search filter input - remove undesired blur (#110314)
* ux filter input - remove undesired blur on input field * adjust types
This commit is contained in:
parent
682bc7c771
commit
cf24e6ca76
1 changed files with 56 additions and 66 deletions
|
@ -27,7 +27,6 @@ import {
|
|||
EuiIcon,
|
||||
EuiBadge,
|
||||
EuiButtonIcon,
|
||||
EuiOutsideClickDetector,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
@ -100,9 +99,6 @@ export function SelectableUrlList({
|
|||
onTermChange();
|
||||
onApply();
|
||||
setPopoverIsOpen(false);
|
||||
if (searchRef) {
|
||||
searchRef.blur();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -120,15 +116,11 @@ export function SelectableUrlList({
|
|||
|
||||
const closePopover = () => {
|
||||
setPopoverIsOpen(false);
|
||||
if (searchRef) {
|
||||
searchRef.blur();
|
||||
}
|
||||
};
|
||||
|
||||
// @ts-ignore - not sure, why it's not working
|
||||
useEvent('keydown', onEnterKey, searchRef);
|
||||
useEvent('escape', () => setPopoverIsOpen(false), searchRef);
|
||||
useEvent('blur', () => setPopoverIsOpen(false), searchRef);
|
||||
|
||||
useEffect(() => {
|
||||
if (searchRef && initialValue) {
|
||||
|
@ -207,7 +199,6 @@ export function SelectableUrlList({
|
|||
allowExclusions={true}
|
||||
>
|
||||
{(list, search) => (
|
||||
<EuiOutsideClickDetector onOutsideClick={() => closePopover()}>
|
||||
<EuiPopover
|
||||
panelPaddingSize="none"
|
||||
isOpen={popoverIsOpen}
|
||||
|
@ -265,7 +256,6 @@ export function SelectableUrlList({
|
|||
</EuiPopoverFooter>
|
||||
</div>
|
||||
</EuiPopover>
|
||||
</EuiOutsideClickDetector>
|
||||
)}
|
||||
</EuiSelectable>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue