Skip to content

Commit 2351ca8

Browse files
committed
Properly handle textarea children
1 parent 739f88d commit 2351ca8

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.changeset/nasty-moles-kneel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@compai/css-gui': patch
3+
---
4+
5+
Handle textarea children

packages/gui/src/components/html/Renderer/Element.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export function ElementRenderer({
3838
return <Tag {...props} onClick={handleClick} />
3939
}
4040

41+
if (Tag === 'textarea' && value.children) {
42+
return (
43+
<Tag {...props} onClick={handleClick}>
44+
{value.children.map((child) => child.value).join(' ')}
45+
</Tag>
46+
)
47+
}
48+
4149
return (
4250
<Tag {...props} onClick={handleClick}>
4351
<ChildrenRenderer value={value.children} path={path} />

0 commit comments

Comments
 (0)