Skip to content

Commit

Permalink
[BUG][Console] Fix updating of play and wrench button
Browse files Browse the repository at this point in the history
Fix UI bug that did not update the console with the correct
values.

offsetTop was always 0 and the value needed the pixel.

Issue:
#3916

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
  • Loading branch information
kavilla committed Apr 21, 2023
1 parent 86d42bc commit f454bb6
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit f454bb6

Please sign in to comment.