mirror of https://github.com/apache/superset.git
fix(native-filters): Fix Select `Default First Value` by clicked `Clear All` (#15219)
* fix:fix get permission function * fix: fix select first value by clear all * lint: fix lint
This commit is contained in:
parent
e5187a479a
commit
fe5381dcb8
|
@ -92,7 +92,11 @@ const Header: FC<HeaderProps> = ({
|
|||
const handleClearAll = () => {
|
||||
filterValues.forEach(filter => {
|
||||
setDataMaskSelected(draft => {
|
||||
draft[filter.id] = getInitialDataMask(filter.id);
|
||||
draft[filter.id] = getInitialDataMask(filter.id, {
|
||||
filterState: {
|
||||
value: null,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
@ -37,8 +37,11 @@ import {
|
|||
import { areObjectsEqual } from '../reduxUtils';
|
||||
import { Filters } from '../dashboard/reducers/types';
|
||||
|
||||
export function getInitialDataMask(id?: string): DataMask;
|
||||
export function getInitialDataMask(id: string): DataMaskWithId {
|
||||
export function getInitialDataMask(id?: string, moreProps?: DataMask): DataMask;
|
||||
export function getInitialDataMask(
|
||||
id: string,
|
||||
moreProps: DataMask = {},
|
||||
): DataMaskWithId {
|
||||
let otherProps = {};
|
||||
if (id) {
|
||||
otherProps = {
|
||||
|
@ -52,6 +55,7 @@ export function getInitialDataMask(id: string): DataMaskWithId {
|
|||
value: undefined,
|
||||
},
|
||||
ownState: {},
|
||||
...moreProps,
|
||||
} as DataMaskWithId;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue