fix: Charts sort by in edit mode gets cut off (#15896)
diff --git a/superset-frontend/spec/javascripts/dashboard/components/SliceAdder_spec.jsx b/superset-frontend/spec/javascripts/dashboard/components/SliceAdder_spec.jsx
index 2a0cb55..16703d0 100644
--- a/superset-frontend/spec/javascripts/dashboard/components/SliceAdder_spec.jsx
+++ b/superset-frontend/spec/javascripts/dashboard/components/SliceAdder_spec.jsx
@@ -155,10 +155,10 @@
});
it('handleSelect', () => {
- const newSortBy = { value: 'viz_type' };
+ const newSortBy = 'viz_type';
wrapper.instance().handleSelect(newSortBy);
expect(spy.calledOnce).toBe(true);
- expect(spy.lastCall.args[1]).toBe(newSortBy.value);
+ expect(spy.lastCall.args[1]).toBe(newSortBy);
});
it('handleKeyPress', () => {
diff --git a/superset-frontend/src/components/Select/Select.tsx b/superset-frontend/src/components/Select/Select.tsx
index 1ceca53..624571c 100644
--- a/superset-frontend/src/components/Select/Select.tsx
+++ b/superset-frontend/src/components/Select/Select.tsx
@@ -97,6 +97,12 @@
&& .ant-select-selector {
border-radius: ${theme.gridUnit}px;
}
+
+ // Open the dropdown when clicking on the suffix
+ // This is fixed in version 4.16
+ .ant-select-arrow .anticon:not(.ant-select-suffix) {
+ pointer-events: none;
+ }
`}
`;
diff --git a/superset-frontend/src/dashboard/components/SliceAdder.jsx b/superset-frontend/src/dashboard/components/SliceAdder.jsx
index 12d62c5..ef1e446 100644
--- a/superset-frontend/src/dashboard/components/SliceAdder.jsx
+++ b/superset-frontend/src/dashboard/components/SliceAdder.jsx
@@ -23,7 +23,7 @@
import { createFilter } from 'react-search-input';
import { t, styled } from '@superset-ui/core';
import { Input } from 'src/common/components';
-import Select from 'src/components/Select';
+import { Select } from 'src/components';
import Loading from 'src/components/Loading';
import {
CHART_TYPE,
@@ -168,8 +168,7 @@
}));
}
- handleSelect(object) {
- const sortBy = object.value;
+ handleSelect(sortBy) {
this.setState(prevState => ({
sortBy,
filteredSlices: this.getFilteredSortedSlices(