fix(FillSpace): prevent aboveRef, belowRef, and onMeasurement from leaking to DOM

This commit is contained in:
seb
2026-09-16 10:06:05 +02:00
parent 07a3809f1b
commit 8ddca02e54
2 changed files with 80 additions and 14 deletions

View File

@@ -16,9 +16,11 @@ class FillSpaceMockPage extends Component {
this.ex1 = { header: createRef(), footer: createRef() };
this.ex2 = { header: createRef(), footer: createRef() };
this.ex3 = { header: createRef(), footer: createRef() };
this.state = { fitCount: null };
}
render() {
const { fitCount } = this.state;
return (
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
<Typography variant="body2" color="text.secondary">
@@ -54,6 +56,7 @@ class FillSpaceMockPage extends Component {
<Typography variant="body2">Einheit</Typography>
</Box>
}
onMeasurement={(count) => this.setState({ fitCount: count })}
>
<Box
sx={{
@@ -69,6 +72,29 @@ class FillSpaceMockPage extends Component {
Diese Zeilen stehen oben, darunter wiederholt sich die
Einheit bis zum Seitenende.
</Typography>
<Box
sx={{
mt: 1,
px: 1.5,
py: 0.75,
borderRadius: 1,
bgcolor: 'background.paper',
border: '1px dashed',
borderColor: 'divider',
}}
>
<Typography variant="caption" component="span">
📏 onMeasurement (würden ohne Inhalt passen):&nbsp;
</Typography>
<Typography
variant="caption"
component="span"
fontWeight={700}
color="primary"
>
{fitCount != null ? `${fitCount} Einheiten` : '…'}
</Typography>
</Box>
</Box>
</FillSpace>