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,
|
actions,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const { columns, metrics } = datasource;
|
const { columns, metrics } = datasource;
|
||||||
|
const [inputValue, setInputValue] = useState('');
|
||||||
const [lists, setList] = useState({
|
const [lists, setList] = useState({
|
||||||
columns,
|
columns,
|
||||||
metrics,
|
metrics,
|
||||||
|
@ -168,6 +169,7 @@ export default function DataSourcePanel({
|
||||||
columns,
|
columns,
|
||||||
metrics,
|
metrics,
|
||||||
});
|
});
|
||||||
|
setInputValue('');
|
||||||
}, [columns, datasource, metrics]);
|
}, [columns, datasource, metrics]);
|
||||||
|
|
||||||
const metricSlice = lists.metrics.slice(0, 50);
|
const metricSlice = lists.metrics.slice(0, 50);
|
||||||
|
@ -178,8 +180,10 @@ export default function DataSourcePanel({
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
onChange={evt => {
|
onChange={evt => {
|
||||||
|
setInputValue(evt.target.value);
|
||||||
search(evt.target.value);
|
search(evt.target.value);
|
||||||
}}
|
}}
|
||||||
|
value={inputValue}
|
||||||
className="form-control input-md"
|
className="form-control input-md"
|
||||||
placeholder={t('Search Metrics & Columns')}
|
placeholder={t('Search Metrics & Columns')}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue