From f4ee7efec42cf8e5d4d04b98c1335531cd5310c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bl=C3=A4sta?= Date: Wed, 1 Feb 2023 16:40:08 +0100 Subject: [PATCH 1/6] fix: search result not hidden in legend search --- scss/externs/_awesomplete.base.scss | 10 +++++++++- src/controls/legend.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scss/externs/_awesomplete.base.scss b/scss/externs/_awesomplete.base.scss index 56510acac..a4c21481e 100644 --- a/scss/externs/_awesomplete.base.scss +++ b/scss/externs/_awesomplete.base.scss @@ -15,6 +15,14 @@ width: 100%; } +.awesomplete.black { + display: flex; + flex-direction: row; + flex-grow: 1; + position: fixed; + min-width: 180px; +} + .awesomplete > input { display: block; } @@ -39,7 +47,7 @@ left: 0px; list-style: none; margin: 0; - min-width: 100%; + min-width: 180px; padding: 0; position: absolute; top: auto; diff --git a/src/controls/legend.js b/src/controls/legend.js index f117bd785..2ee170ba2 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -257,7 +257,7 @@ const Legend = function Legend(options = {}) { const layerSearchInput = Input({ cls: 'o-search-layer-field placeholder-text-smaller smaller', - style: { height: '1.5rem', margin: 0, width: '100%' }, + style: { height: '1.5rem', margin: 0, width: '180px' }, placeholderText: searchLayersPlaceholderText, value: '' }); From 3c1b4b828caf8cdf49128acb04940cef70a22f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bl=C3=A4sta?= Date: Thu, 2 Feb 2023 17:01:26 +0100 Subject: [PATCH 2/6] added wrapper element --- scss/externs/_awesomplete.base.scss | 4 ++-- src/controls/legend.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scss/externs/_awesomplete.base.scss b/scss/externs/_awesomplete.base.scss index a4c21481e..f4c21e5f3 100644 --- a/scss/externs/_awesomplete.base.scss +++ b/scss/externs/_awesomplete.base.scss @@ -20,7 +20,7 @@ flex-direction: row; flex-grow: 1; position: fixed; - min-width: 180px; + min-width: 100%; } .awesomplete > input { @@ -47,7 +47,7 @@ left: 0px; list-style: none; margin: 0; - min-width: 180px; + min-width: 100%; padding: 0; position: absolute; top: auto; diff --git a/src/controls/legend.js b/src/controls/legend.js index 2ee170ba2..01f31b784 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -480,7 +480,14 @@ const Legend = function Legend(options = {}) { toolsEl.insertBefore(dom.html(divider.render()), toolsEl.firstChild); toolsEl.insertBefore(dom.html(button.render()), toolsEl.firstChild); } else { - toolsEl.appendChild(dom.html(button.render())); + if (typeof button.getValue === 'function') { + const node = document.createElement("div"); + node.classList.add("grow"); + toolsEl.appendChild(node); + node.appendChild(dom.html(button.render())); + } else { + toolsEl.appendChild(dom.html(button.render())); + } } toolsCmp.addComponent(button); button.onRender(); From b466a5a2210ab0d7258fee19677e34912783bddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bl=C3=A4sta?= Date: Tue, 7 Feb 2023 10:46:56 +0100 Subject: [PATCH 3/6] Fixed width on search list --- scss/externs/_awesomplete.base.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scss/externs/_awesomplete.base.scss b/scss/externs/_awesomplete.base.scss index f4c21e5f3..bbc3c3639 100644 --- a/scss/externs/_awesomplete.base.scss +++ b/scss/externs/_awesomplete.base.scss @@ -47,7 +47,7 @@ left: 0px; list-style: none; margin: 0; - min-width: 100%; + min-width: 180px; padding: 0; position: absolute; top: auto; From 8d0f0292272672aaca930a535c7ecd2255fdeca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bl=C3=A4sta?= Date: Tue, 7 Feb 2023 11:22:59 +0100 Subject: [PATCH 4/6] Lint fix --- src/controls/legend.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 01f31b784..b29908d16 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -480,9 +480,9 @@ const Legend = function Legend(options = {}) { toolsEl.insertBefore(dom.html(divider.render()), toolsEl.firstChild); toolsEl.insertBefore(dom.html(button.render()), toolsEl.firstChild); } else { + const node = document.createElement('div'); if (typeof button.getValue === 'function') { - const node = document.createElement("div"); - node.classList.add("grow"); + node.classList.add('grow'); toolsEl.appendChild(node); node.appendChild(dom.html(button.render())); } else { From e93b0d316e6e4fa429f052385a19d75e42cefbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bl=C3=A4sta?= Date: Tue, 7 Feb 2023 14:38:16 +0100 Subject: [PATCH 5/6] max width on search result --- scss/externs/_awesomplete.base.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/scss/externs/_awesomplete.base.scss b/scss/externs/_awesomplete.base.scss index bbc3c3639..c840bc29e 100644 --- a/scss/externs/_awesomplete.base.scss +++ b/scss/externs/_awesomplete.base.scss @@ -48,6 +48,7 @@ list-style: none; margin: 0; min-width: 180px; + max-width: 220px; padding: 0; position: absolute; top: auto; From ab1246368c9ff0f9d2a94c1144858a2099dd9449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bl=C3=A4sta?= Date: Tue, 7 Feb 2023 15:57:21 +0100 Subject: [PATCH 6/6] break words --- scss/externs/_awesomplete.base.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/scss/externs/_awesomplete.base.scss b/scss/externs/_awesomplete.base.scss index c840bc29e..181e88883 100644 --- a/scss/externs/_awesomplete.base.scss +++ b/scss/externs/_awesomplete.base.scss @@ -49,6 +49,7 @@ margin: 0; min-width: 180px; max-width: 220px; + overflow-wrap: break-word; padding: 0; position: absolute; top: auto;