From 169535afab16a27306f3fecf8d2b8e9fe89eb509 Mon Sep 17 00:00:00 2001 From: Kyle Knight Date: Wed, 1 Mar 2017 13:11:09 -0600 Subject: [PATCH] Fix max-height issue with Full Screen Query Results (#1323) --- CHANGELOG.md | 2 ++ .../SelectTargetsDropdown.jsx | 1 - .../queries/QueryResultsTable/_styles.scss | 2 ++ .../pages/queries/QueryPage/QueryPage.jsx | 23 ++++++++++--------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 733db20bc..64a56f4f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Fix issue with Distributed Query Pack results full screen feature that broke the browser scrolling abilities + ## Kolide 1.0.1 (February 27, 2017) ## * Fix an issue that prevented users from replacing deleted labels with a new label of the same name. diff --git a/frontend/components/forms/fields/SelectTargetsDropdown/SelectTargetsDropdown.jsx b/frontend/components/forms/fields/SelectTargetsDropdown/SelectTargetsDropdown.jsx index 1f0af39cf..742f3112e 100644 --- a/frontend/components/forms/fields/SelectTargetsDropdown/SelectTargetsDropdown.jsx +++ b/frontend/components/forms/fields/SelectTargetsDropdown/SelectTargetsDropdown.jsx @@ -88,7 +88,6 @@ class SelectTargetsDropdown extends Component { const currentWrapperHeight = coreWrapper.scrollHeight; if (wrapperHeight < currentWrapperHeight) { - console.log(`Grow wrapper by ${currentWrapperHeight - wrapperHeight}px`); coreWrapper.style.height = `${wrapperHeight + (currentWrapperHeight - wrapperHeight) + 15}px`; } } diff --git a/frontend/components/queries/QueryResultsTable/_styles.scss b/frontend/components/queries/QueryResultsTable/_styles.scss index acdba2de7..2bb39474d 100644 --- a/frontend/components/queries/QueryResultsTable/_styles.scss +++ b/frontend/components/queries/QueryResultsTable/_styles.scss @@ -4,7 +4,9 @@ background-color: $white; padding: $pad-base; width: 100%; + min-height: calc(500px + (#{$pad-base} * 2)); box-sizing: border-box; + max-height: 75vh; &__button-wrap { @include clearfix; diff --git a/frontend/pages/queries/QueryPage/QueryPage.jsx b/frontend/pages/queries/QueryPage/QueryPage.jsx index 18ccce2b0..ba5274bad 100644 --- a/frontend/pages/queries/QueryPage/QueryPage.jsx +++ b/frontend/pages/queries/QueryPage/QueryPage.jsx @@ -98,7 +98,10 @@ export class QueryPage extends Component { } componentWillUnmount () { + const { dispatch } = this.props; + this.resetCampaignAndTargets(); + dispatch(toggleSmallNav); return false; } @@ -296,22 +299,20 @@ export class QueryPage extends Component { right: `${rect.right - rect.left}px`, bottom: `${rect.bottom - rect.top}px`, maxWidth: `${parent.offsetWidth}px`, - minWidth: `${parent.offsetWidth}px`, maxHeight: `${parent.offsetHeight}px`, - minHeight: `${parent.offsetHeight}px`, position: 'fixed', }; const resetPosition = { - position: 'static', - maxWidth: 'auto', - minWidth: 'auto', - maxHeight: 'auto', - minHeight: 'auto', - top: 'auto', - right: 'auto', - bottom: 'auto', - left: 'auto', + position: null, + maxWidth: null, + minWidth: null, + maxHeight: null, + minHeight: null, + top: null, + right: null, + bottom: null, + left: null, }; let newPosition = clone(defaultPosition);