fix: Charts sort by in edit mode gets cut off (#15896)

This commit is contained in:
Michael S. Molina 2021-07-26 16:38:38 -03:00 committed by GitHub
parent 7aeb15031d
commit 5be0a89625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -155,10 +155,10 @@ describe('SliceAdder', () => {
}); });
it('handleSelect', () => { it('handleSelect', () => {
const newSortBy = { value: 'viz_type' }; const newSortBy = 'viz_type';
wrapper.instance().handleSelect(newSortBy); wrapper.instance().handleSelect(newSortBy);
expect(spy.calledOnce).toBe(true); expect(spy.calledOnce).toBe(true);
expect(spy.lastCall.args[1]).toBe(newSortBy.value); expect(spy.lastCall.args[1]).toBe(newSortBy);
}); });
it('handleKeyPress', () => { it('handleKeyPress', () => {

View File

@ -97,6 +97,12 @@ const StyledSelect = styled(AntdSelect, {
&& .ant-select-selector { && .ant-select-selector {
border-radius: ${theme.gridUnit}px; 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;
}
`} `}
`; `;

View File

@ -23,7 +23,7 @@ import { List } from 'react-virtualized';
import { createFilter } from 'react-search-input'; import { createFilter } from 'react-search-input';
import { t, styled } from '@superset-ui/core'; import { t, styled } from '@superset-ui/core';
import { Input } from 'src/common/components'; import { Input } from 'src/common/components';
import Select from 'src/components/Select'; import { Select } from 'src/components';
import Loading from 'src/components/Loading'; import Loading from 'src/components/Loading';
import { import {
CHART_TYPE, CHART_TYPE,
@ -168,8 +168,7 @@ class SliceAdder extends React.Component {
})); }));
} }
handleSelect(object) { handleSelect(sortBy) {
const sortBy = object.value;
this.setState(prevState => ({ this.setState(prevState => ({
sortBy, sortBy,
filteredSlices: this.getFilteredSortedSlices( filteredSlices: this.getFilteredSortedSlices(