Skip to content

Commit f018baa

Browse files
committed
Fix height on initial rendering
1 parent 52cf644 commit f018baa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

streamlit_condition_tree/frontend/src/ConditionTree.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ class ConditionTree extends StreamlitComponentBase<State> {
5555
public constructor(props: ComponentProps) {
5656
super(props);
5757

58-
console.log(AntdConfig)
59-
6058
const config: Config = {
6159
...defaultConfig,
6260
...props.args['config']
@@ -116,6 +114,14 @@ class ConditionTree extends StreamlitComponentBase<State> {
116114
.querySelectorAll('.rule_group>.group--children:has(> :nth-child(1):last-child)')
117115
.forEach((x) => x.classList.add('single-child'))
118116

117+
this.setHeight()
118+
}
119+
120+
componentDidMount = () => {
121+
this.setHeight()
122+
}
123+
124+
private setHeight = () => {
119125
// Set frame height
120126
const height = Math.max(
121127
document.body.scrollHeight + 20,

0 commit comments

Comments
 (0)