From c5f685fa70c854e36bc58fc4cf27ece9280659d9 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Wed, 16 Sep 2020 15:51:40 +0200 Subject: [PATCH 1/2] fix: filter bar position (DHIS2-9453) The calculation of the position of the filter bar was based on the height of the control bar. After the change for the scrollbar, the filter bar was positioned lower than where it should have. Removing the height of the control bar from the top position of the filter bar puts it back in the right place. --- src/components/FilterBar/FilterBar.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/FilterBar/FilterBar.js b/src/components/FilterBar/FilterBar.js index 1466360d6..cfc661411 100644 --- a/src/components/FilterBar/FilterBar.js +++ b/src/components/FilterBar/FilterBar.js @@ -5,8 +5,6 @@ import PropTypes from 'prop-types' import FilterBadge from './FilterBadge' import { sGetNamedItemFilters } from '../../reducers/itemFilters' -import { sGetControlBarUserRows } from '../../reducers/controlBar' -import { getControlBarHeight } from '../ControlBar/controlBarDimensions' import { acRemoveItemFilter } from '../../actions/itemFilters' import { acSetActiveModalDimension } from '../../actions/activeModalDimension' @@ -25,12 +23,10 @@ export class FilterBar extends Component { } render() { - const { filters, userRows } = this.props - - const top = getControlBarHeight(userRows) + 10 + const { filters } = this.props return filters.length ? ( -
+
{filters.map(filter => ( ({ filters: sGetNamedItemFilters(state), - userRows: sGetControlBarUserRows(state), }) export default connect(mapStateToProps, { From 20826b1688fed5331bbda25e2a64a36db12b3040 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Thu, 17 Sep 2020 10:26:17 +0200 Subject: [PATCH 2/2] chore: explain the FilterBar top position value --- src/components/FilterBar/FilterBar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/FilterBar/FilterBar.js b/src/components/FilterBar/FilterBar.js index cfc661411..fb3ac84b7 100644 --- a/src/components/FilterBar/FilterBar.js +++ b/src/components/FilterBar/FilterBar.js @@ -26,6 +26,7 @@ export class FilterBar extends Component { const { filters } = this.props return filters.length ? ( + // the 3 is calculated so that the FilterBar has the same vertical position as the TitleBar in relation to the ControlBar
{filters.map(filter => (