Skip to content

Commit

Permalink
[FIX] devtools: Fix bad computation of highlight boxes on the page
Browse files Browse the repository at this point in the history
This commit adds box-sizing: border-box to the highlight elements
created by the devtools on the page. This was making some of the
boxes overflow on some pages (like on POS sessions) because
the border-box box-sizing was not the default behavior on these
pages.
  • Loading branch information
juliusc2066 authored and ged-odoo committed Apr 6, 2023
1 parent 94ae940 commit 23acf20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/devtools/src/page_scripts/owl_devtools_global_hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
highlight.style.left = `${left}px`;
highlight.style.width = `${width}px`;
highlight.style.height = `${height}px`;
highlight.style.boxSizing = "border-box";
highlight.style.position = "fixed";
highlight.style.backgroundColor = "rgba(15, 139, 245, 0.4)";
highlight.style.borderStyle = "solid";
Expand All @@ -524,6 +525,7 @@
highlightMargins.style.height = `${height + marginBottom + marginTop}px`;
highlightMargins.style.position = "fixed";
highlightMargins.style.borderStyle = "solid";
highlightMargins.style.boxSizing = "border-box";
highlightMargins.style.borderWidth = `${marginTop}px ${marginRight}px ${marginBottom}px ${marginLeft}px`;
highlightMargins.style.borderColor = "rgba(241, 179, 121, 0.4)";
highlightMargins.style.zIndex = "10000";
Expand All @@ -537,6 +539,7 @@
highlight.style.left = `${left}px`;
highlight.style.width = `${width}px`;
highlight.style.height = `${height}px`;
highlight.style.boxSizing = "border-box";
highlight.style.position = "fixed";
highlight.style.backgroundColor = "rgba(15, 139, 245, 0.4)";
highlight.style.zIndex = "10000";
Expand Down

0 comments on commit 23acf20

Please sign in to comment.