How to create a search field with elastic ui and react?

147 Views Asked by At

I have 4 number fields, and a search field above them.

My goal is to show only the searched fields, like someone type in the search field "green"...then only display NumberField2 with the label "green".

Any ideas what is the easiest way to make it work?


 <Segment>
    <EuiFieldSearch
        placeholder="Search..."
    />
    <EuiFlexGroup id="myForm">
        <EuiFlexItem grow={3}>
            <EuiFormRow class="myFormInput" label="blue">
                <EuiFieldNumber
                    className='new-budget-input'
                    step={1}
                    min={1}
                    name="NumberField1"
                    aria-label="Use aria labels when no actual label is in use"
                    onChange={(e) => handleInputChange(e)}
                />
            </EuiFormRow>
            <EuiFormRow class="myFormInput" label="green">
                <EuiFieldNumber
                    className='new-budget-input'
                    step={1}
                    min={1}
                    name="NumberField2"
                    aria-label="Use aria labels when no actual label is in use"
                    onChange={(e) => handleInputChange(e)}
                />
            </EuiFormRow>
            <EuiFormRow class="myFormInput" label="red">
                <EuiFieldNumber
                    className='new-budget-input'
                    step={1}
                    min={1}
                    name="NumberField3"
                    aria-label="Use aria labels when no actual label is in use"
                    onChange={(e) => handleInputChange(e)}
                />
            </EuiFormRow>
            <EuiFormRow class="myFormInput" label="yellow">
                <EuiFieldNumber
                    className='new-budget-input'
                    step={1}
                    min={1}
                    name="NumberField4"
                    aria-label="Use aria labels when no actual label is in use"
                    onChange={(e) => handleInputChange(e)}
                />
            </EuiFormRow>
        </EuiFlexItem>
    </EuiFlexGroup>
</Segment>
0

There are 0 best solutions below