mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-20 23:18:01 +00:00
Fix issue-4276: UI: Filter Schema once added unable to remove (#4320)
This commit is contained in:
parent
eccbbe11c7
commit
d41bf6cab6
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
import { isUndefined } from 'lodash';
|
import { isUndefined } from 'lodash';
|
||||||
import React, { KeyboardEventHandler, useState } from 'react';
|
import React, { KeyboardEventHandler, useState } from 'react';
|
||||||
|
import { MultiValue } from 'react-select';
|
||||||
import CreatableSelect from 'react-select/creatable';
|
import CreatableSelect from 'react-select/creatable';
|
||||||
import { reactSelectCustomStyle } from './reactSelectCustomStyle';
|
import { reactSelectCustomStyle } from './reactSelectCustomStyle';
|
||||||
|
|
||||||
@ -52,6 +53,12 @@ const ReactSelectMultiInput = ({
|
|||||||
setinputValue(input);
|
setinputValue(input);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleChange = (newValue: MultiValue<unknown>) => {
|
||||||
|
const data = newValue as Option[];
|
||||||
|
setValues(data);
|
||||||
|
getTagValue(data.map((v) => v.value));
|
||||||
|
};
|
||||||
|
|
||||||
const handleKeyDown: KeyboardEventHandler<HTMLDivElement> = (event) => {
|
const handleKeyDown: KeyboardEventHandler<HTMLDivElement> = (event) => {
|
||||||
if (!inputValue) return;
|
if (!inputValue) return;
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
@ -76,6 +83,7 @@ const ReactSelectMultiInput = ({
|
|||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
styles={reactSelectCustomStyle}
|
styles={reactSelectCustomStyle}
|
||||||
value={values}
|
value={values}
|
||||||
|
onChange={handleChange}
|
||||||
onInputChange={handleInputChange}
|
onInputChange={handleInputChange}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
/>
|
/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user