mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudWatch: Fix code editor not resizing on mount when content height is > 200px (#81911)
This commit is contained in:
parent
42d6e176bc
commit
7f109c885d
@ -29,8 +29,9 @@ export function MathExpressionQueryField({ expression: query, onChange, datasour
|
|||||||
// We may wish to consider abstracting it into the grafana/ui repo in the future
|
// We may wish to consider abstracting it into the grafana/ui repo in the future
|
||||||
const updateElementHeight = () => {
|
const updateElementHeight = () => {
|
||||||
const containerDiv = containerRef.current;
|
const containerDiv = containerRef.current;
|
||||||
if (containerDiv !== null && editor.getContentHeight() < 200) {
|
if (containerDiv !== null) {
|
||||||
const pixelHeight = Math.max(32, editor.getContentHeight());
|
const maxPixelHeight = Math.min(200, editor.getContentHeight());
|
||||||
|
const pixelHeight = Math.max(32, maxPixelHeight);
|
||||||
containerDiv.style.height = `${pixelHeight}px`;
|
containerDiv.style.height = `${pixelHeight}px`;
|
||||||
containerDiv.style.width = '100%';
|
containerDiv.style.width = '100%';
|
||||||
const pixelWidth = containerDiv.clientWidth;
|
const pixelWidth = containerDiv.clientWidth;
|
||||||
|
Loading…
Reference in New Issue
Block a user