You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by yj...@apache.org on 2021/01/13 01:17:05 UTC

[superset] branch master updated: fix: do not show vertical scrollbar for charts in dashboard (#12478)

This is an automated email from the ASF dual-hosted git repository.

yjc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e9d66e9  fix: do not show vertical scrollbar for charts in dashboard (#12478)
e9d66e9 is described below

commit e9d66e904f9dfdaab26ee3cc208fbcfddbed1df9
Author: Grace Guo <gr...@airbnb.com>
AuthorDate: Tue Jan 12 17:16:25 2021 -0800

    fix: do not show vertical scrollbar for charts in dashboard (#12478)
    
    * fix: do not show vertical scrollbar for charts in dashboard
    
    * Proper fix for #11419
    
    Co-authored-by: Jesse Yang <je...@airbnb.com>
---
 .../src/dashboard/stylesheets/components/chart.less       |  6 ------
 .../src/visualizations/FilterBox/FilterBox.jsx            | 15 ++++-----------
 .../src/visualizations/FilterBox/transformProps.js        |  4 ++++
 3 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/superset-frontend/src/dashboard/stylesheets/components/chart.less b/superset-frontend/src/dashboard/stylesheets/components/chart.less
index 9ebb11f..422a7db 100644
--- a/superset-frontend/src/dashboard/stylesheets/components/chart.less
+++ b/superset-frontend/src/dashboard/stylesheets/components/chart.less
@@ -114,12 +114,6 @@
   }
 }
 
-.chart-slice {
-  height: calc(100% - 32px);
-  overflow: auto;
-  height: 100%;
-}
-
 .dot {
   @dot-diameter: 4px;
 
diff --git a/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx
index 4880a38..9fea2c3 100644
--- a/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx
+++ b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx
@@ -22,7 +22,7 @@ import { debounce } from 'lodash';
 import { max as d3Max } from 'd3-array';
 import { AsyncCreatableSelect, CreatableSelect } from 'src/components/Select';
 import Button from 'src/components/Button';
-import { t, styled, SupersetClient } from '@superset-ui/core';
+import { t, SupersetClient } from '@superset-ui/core';
 
 import { BOOL_FALSE_DISPLAY, BOOL_TRUE_DISPLAY } from 'src/constants';
 import FormLabel from 'src/components/FormLabel';
@@ -95,13 +95,6 @@ const defaultProps = {
   instantFiltering: false,
 };
 
-const Styles = styled.div`
-  height: 100%;
-  min-height: 100%;
-  max-height: 100%;
-  overflow: visible;
-`;
-
 class FilterBox extends React.PureComponent {
   constructor(props) {
     super(props);
@@ -427,9 +420,9 @@ class FilterBox extends React.PureComponent {
   }
 
   render() {
-    const { instantFiltering } = this.props;
+    const { instantFiltering, width, height } = this.props;
     return (
-      <Styles>
+      <div style={{ width, height, overflow: 'auto' }}>
         {this.renderDateFilter()}
         {this.renderDatasourceFilters()}
         {this.renderFilters()}
@@ -443,7 +436,7 @@ class FilterBox extends React.PureComponent {
             {t('Apply')}
           </Button>
         )}
-      </Styles>
+      </div>
     );
   }
 }
diff --git a/superset-frontend/src/visualizations/FilterBox/transformProps.js b/superset-frontend/src/visualizations/FilterBox/transformProps.js
index 4652c6d..dda5558 100644
--- a/superset-frontend/src/visualizations/FilterBox/transformProps.js
+++ b/superset-frontend/src/visualizations/FilterBox/transformProps.js
@@ -27,6 +27,8 @@ export default function transformProps(chartProps) {
     queriesData,
     rawDatasource,
     rawFormData,
+    width,
+    height,
   } = chartProps;
   const {
     onAddFilter = NOOP,
@@ -53,6 +55,8 @@ export default function transformProps(chartProps) {
 
   return {
     chartId: sliceId,
+    width,
+    height,
     datasource: rawDatasource,
     filtersChoices: queriesData[0].data,
     filtersFields,