[ES|QL] Makes the controls values clearable (#217132)

## Summary

Closes https://github.com/elastic/kibana/issues/217077

Adds a clear button in the values dropdowns

<img width="400" alt="image"
src="https://github.com/user-attachments/assets/79d3f615-9ce1-4caa-be65-99895bb35d49"
/>


<img width="373" alt="image"
src="https://github.com/user-attachments/assets/d4edab35-18a4-477c-afb3-a4b316db1a40"
/>
This commit is contained in:
Stratoula Kalafateli 2025-04-08 07:47:43 +02:00 committed by GitHub
parent 1db06dc93c
commit 400a91464d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -9,6 +9,7 @@
import React, { useCallback, useState, useEffect } from 'react';
import useMountedState from 'react-use/lib/useMountedState';
import { css } from '@emotion/react';
import { i18n } from '@kbn/i18n';
import { isEqual } from 'lodash';
import {
@ -207,6 +208,13 @@ export function IdentifierControlForm({
data-test-subj="esqlIdentifiersOptions"
fullWidth
compressed
isClearable
css={css`
.euiFormControlLayoutIcons {
align-items: flex-start;
padding-block-start: 1ch;
}
`}
/>
</EuiFormRow>

View file

@ -337,11 +337,16 @@ export function ValueControlForm({
selectedOptions={selectedValues}
onChange={onValuesChange}
onCreateOption={onCreateOption}
isClearable
fullWidth
compressed
css={css`
max-height: 200px;
overflow-y: auto;
.euiFormControlLayoutIcons {
align-items: flex-start;
padding-block-start: 1ch;
}
`}
/>
</EuiFormRow>