From b8b6dde01f2e98236d06ff900f18d040a0d1f911 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 8 Feb 2021 19:19:33 +0100 Subject: [PATCH] fix: improve positioning of the X button in the dashboard search input (#1512) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: adjust css to place X button correctly * fix: update snapshots Co-authored-by: Jan Henrik Ă˜verland --- src/components/ControlBar/Filter.js | 16 +- .../__snapshots__/DashboardsBar.spec.js.snap | 186 ++++++++++-------- .../__snapshots__/Filter.spec.js.snap | 106 +++++----- .../ControlBar/styles/ClearButton.module.css | 6 + .../ControlBar/styles/Filter.module.css | 26 ++- 5 files changed, 204 insertions(+), 136 deletions(-) diff --git a/src/components/ControlBar/Filter.js b/src/components/ControlBar/Filter.js index 0740e6faf..f42db7f82 100644 --- a/src/components/ControlBar/Filter.js +++ b/src/components/ControlBar/Filter.js @@ -81,10 +81,12 @@ export const FilterUnconnected = ({ onFocus={onFocus} onBlur={onBlur} > - +
+ +
- {filterText && } + {filterText && ( +
+ +
+ )} ) } diff --git a/src/components/ControlBar/__tests__/__snapshots__/DashboardsBar.spec.js.snap b/src/components/ControlBar/__tests__/__snapshots__/DashboardsBar.spec.js.snap index b3e1a3733..f4aebeb4d 100644 --- a/src/components/ControlBar/__tests__/__snapshots__/DashboardsBar.spec.js.snap +++ b/src/components/ControlBar/__tests__/__snapshots__/DashboardsBar.spec.js.snap @@ -36,21 +36,25 @@ exports[`clicking "Show more" maximizes dashboards bar height 1`] = `
- - - - + + + + +
- - - - + + + + + - - - - + + + + + - - - - + + + + + - - - - + + + + + - - - + + + + - - - - + + + + + - - - - + + + + + - + + `; diff --git a/src/components/ControlBar/styles/ClearButton.module.css b/src/components/ControlBar/styles/ClearButton.module.css index 183c8172d..5f22c92fc 100644 --- a/src/components/ControlBar/styles/ClearButton.module.css +++ b/src/components/ControlBar/styles/ClearButton.module.css @@ -20,3 +20,9 @@ width: 16px; height: 16px; } + +@media only screen and (max-width: 480px) { + .button { + margin-bottom: var(--spacers-dp4); + } +} diff --git a/src/components/ControlBar/styles/Filter.module.css b/src/components/ControlBar/styles/Filter.module.css index 37d261d20..7ee7ac50c 100644 --- a/src/components/ControlBar/styles/Filter.module.css +++ b/src/components/ControlBar/styles/Filter.module.css @@ -1,17 +1,21 @@ .container { + top: -4px; width: 200px; - height: 36px; + height: 30px; position: relative; align-items: center; display: inline-flex; line-height: 1.1875em; - padding-top: var(--spacers-dp8); } .input { font-size: 14px; border: none; - margin-left: var(--spacers-dp8); + width: 100%; + box-sizing: content-box; + min-width: 0px; + margin: 0; + padding: 6px 0 7px; } .input::placeholder { @@ -61,6 +65,22 @@ cursor: pointer; } +.searchIconContainer { + height: 0.01em; + max-height: 2em; + display: flex; + align-items: center; + margin-right: 8px; +} + +.clearButtonContainer { + height: 0.01em; + max-height: 2em; + display: flex; + align-items: center; + margin-left: 8px; +} + @media only screen and (max-width: 480px) { .container { height: 24px;