Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes elastic#208305 ## Summary This PR is a better solution for the issue described in elastic#208247. In that PR, we found that the drag preview was causing panels to resize unnecessarily at seemingly random occurrences, which was causing huge lag spikes and errors to be thrown. While making the drag preview absolute positioned did resolve that problem, it caused other issues (such as [this one](elastic#208305)) because the drag preview no longer took up height in the parent. Therefore, we decided to revisit this and, upon further investigation, we found that the resize observers were **specifically** firing whenever the viewport has a width that cannot be evenly divided into 48 columns, which causes inconsistent rounding of pixels for each column on render. The reason the drag preview in particular made this issue more apparent is because, when rendering it as a `block`, it is causing the DOM to repaint as it changes target column + row - which then caused the CSS grid columns to "flicker" between widths that differed by less than half a pixel. In the following GIF, you can see this flicker in the panel widths as I drag another panel around:  This then repeatedly triggered `resizeObservers` for panels that had them. Instead of relying on the `fr` unit, which is giving us inconsistent column widths as shown above (most likely due to a rounding bug with the `fr` unit in Chrome, since it works fine in Firefox), I have instead migrated to a more static way of calculating `grid-template-columns` by simply subtracting the pixels that the gutters take up from `100%` in order to determine the width of a column. This still resolves the resize observer problem, but it does so while still allowing the drag preview to be rendered as a block. ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information