fix(FillSpace): prevent aboveRef, belowRef, and onMeasurement from leaking to DOM
This commit is contained in:
@@ -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):
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
component="span"
|
||||
fontWeight={700}
|
||||
color="primary"
|
||||
>
|
||||
{fitCount != null ? `${fitCount} Einheiten` : '…'}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</FillSpace>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user