From 8dfd67eccd1f29bd919f09643b4c07ea10dd4a39 Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Fri, 21 Apr 2023 22:43:42 +0000 Subject: [PATCH] [BUG][Console] Fix updating of play and wrench button Fix UI bug that did not update the console with the correct values. offsetTop was always 0 and the value needed the pixel. Issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3916 Signed-off-by: Kawika Avilla --- CHANGELOG.md | 1 + release-notes/opensearch-dashboards.release-notes-2.7.0.md | 1 + .../models/legacy_core_editor/legacy_core_editor.ts | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb7c3fd87322..fad5f10956e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -249,6 +249,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Console] Fix dev tool console autocomplete not loading issue ([#3775](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3775)) - [Console] Fix dev tool console run command with query parameter error ([#3813](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3813)) - Add clarifying tooltips to header navigation ([#3573](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3573)) +- [Console] Fix dev tool console not updating action bar ([#3920](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3920)) ### 🚞 Infrastructure diff --git a/release-notes/opensearch-dashboards.release-notes-2.7.0.md b/release-notes/opensearch-dashboards.release-notes-2.7.0.md index 3ad55fe4d807..7bb3b6833934 100644 --- a/release-notes/opensearch-dashboards.release-notes-2.7.0.md +++ b/release-notes/opensearch-dashboards.release-notes-2.7.0.md @@ -33,6 +33,7 @@ - [Console] Fix/update documentation links in Dev Tools console ([#3724](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3724)) - [Console] Fix dev tool console autocomplete not loading issue ([#3775](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3775)) - [Console] Fix dev tool console run command with query parameter error ([#3813](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3813)) +- [Console] Fix dev tool console not updating action bar ([#3920](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3920)) - [Table Visualization] Fix table rendering empty unused space ([#3797](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3797)) - [Table Visualization] Fix data table not adjusting height on the initial load ([#3816](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3816)) - [Timeline] Fix y-axis label color in dark mode ([#3698](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3698)) diff --git a/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts b/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts index 5fe93ca4e094..d70d3de39a5b 100644 --- a/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts +++ b/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.ts @@ -277,11 +277,11 @@ export class LegacyCoreEditor implements CoreEditor { } else { if (topOrBottom === 'top') { this.actions.style.bottom = 'auto'; - this.actions.style.top = value; + this.actions.style.top = `${value}px`; this.actions.style.visibility = 'visible'; } else { this.actions.style.top = 'auto'; - this.actions.style.bottom = value; + this.actions.style.bottom = `${value}px`; this.actions.style.visibility = 'visible'; } } @@ -320,7 +320,7 @@ export class LegacyCoreEditor implements CoreEditor { // elements are positioned relative to the editor's container // pageY is relative to page, so subtract the offset // from pageY to get the new top value - const offsetFromPage = this.editor.container.offsetTop; + const { top: offsetFromPage } = this.editor.container.getBoundingClientRect(); const startLine = range.start.lineNumber; const startColumn = range.start.column; const firstLine = this.getLineValue(startLine);