mirror of https://github.com/apache/superset.git
feat(explore): clear search on dataset change (#12909)
This commit is contained in:
parent
2f6d1ff4cd
commit
76c225db7e
|
@ -104,6 +104,7 @@ export default function DataSourcePanel({
|
|||
actions,
|
||||
}: Props) {
|
||||
const { columns, metrics } = datasource;
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
const [lists, setList] = useState({
|
||||
columns,
|
||||
metrics,
|
||||
|
@ -168,6 +169,7 @@ export default function DataSourcePanel({
|
|||
columns,
|
||||
metrics,
|
||||
});
|
||||
setInputValue('');
|
||||
}, [columns, datasource, metrics]);
|
||||
|
||||
const metricSlice = lists.metrics.slice(0, 50);
|
||||
|
@ -178,8 +180,10 @@ export default function DataSourcePanel({
|
|||
<input
|
||||
type="text"
|
||||
onChange={evt => {
|
||||
setInputValue(evt.target.value);
|
||||
search(evt.target.value);
|
||||
}}
|
||||
value={inputValue}
|
||||
className="form-control input-md"
|
||||
placeholder={t('Search Metrics & Columns')}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue