mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-07 08:02:40 +00:00
fix: fix autosize when not rendered at initialization
This commit is contained in:
@@ -17,6 +17,13 @@ export const action = (node) => {
|
||||
const setInitialHeight = () => {
|
||||
let height = 0
|
||||
|
||||
const style = window.getComputedStyle(node)
|
||||
const visible = style?.getPropertyValue('visibility') === 'hidden'
|
||||
|
||||
if (visible === false) {
|
||||
return
|
||||
}
|
||||
|
||||
if (node.value) {
|
||||
height = node.scrollHeight
|
||||
} else {
|
||||
@@ -37,7 +44,7 @@ export const action = (node) => {
|
||||
|
||||
const setHeight = () => {
|
||||
node.style.height = '0px'
|
||||
node.style.height = Math.max(node.scrollHeight, 40) + 5 + 'px'
|
||||
node.style.height = Math.max(node.scrollHeight ?? 0, 40) + 5 + 'px'
|
||||
}
|
||||
|
||||
const addStyles = () => {
|
||||
|
||||
Reference in New Issue
Block a user