Skip to content

Commit 36a5308

Browse files
authored
fix(layout_columns): Fix coercion of scalar row height to list for python <= 3.9 (#1494)
1 parent 1a5db90 commit 36a5308

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shiny/ui/_layout_columns.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ def row_heights_attrs(
273273
for brk, heights in x_complete.items():
274274
var = f"--bslib-grid--row-heights--{brk}"
275275

276-
if isinstance(heights, CssUnit):
276+
# We'd use isinstance(heights, CssUnit) (needs Python > 3.9)
277+
# or isinstance_cssunit(heights) (pyright 1.1.369+ doesn't like it)
278+
if isinstance(heights, (str, int, float)):
277279
heights = [heights]
278280

279281
value = " ".join([maybe_fr_unit(h) for h in heights])

0 commit comments

Comments
 (0)