Skip to content

Commit

Permalink
fix(native-filters): allowClear only when required not checked (#14353)
Browse files Browse the repository at this point in the history
* fix(native-filters): allowClear only when required not checked

* Update superset-frontend/src/filters/components/Select/controlPanel.ts

Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>

Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
(cherry picked from commit 8a0d321)
  • Loading branch information
villebro authored and amitmiran137 committed Apr 28, 2021
1 parent e86ac0a commit 23d4313
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
return (
<Styles height={height} width={width}>
<StyledSelect
allowClear
allowClear={!enableEmptyFilter}
// @ts-ignore
value={values}
disabled={forceFirstValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ const config: ControlPanelConfig = {
name: 'enableEmptyFilter',
config: {
type: 'CheckboxControl',
label: t('Enable empty filter'),
label: t('Required'),
default: enableEmptyFilter,
renderTrigger: true,
description: t(
'When selection is empty, an always false filter event be emitted',
'User must select a value for this filter when filter is in single select mode. ' +
'If selection is empty, an always false filter is emitted.',
),
},
},
Expand Down

0 comments on commit 23d4313

Please sign in to comment.