Fix: query heights before set
This commit is contained in:
parent
1cdb2e7e92
commit
0bec3f040b
|
@ -107,10 +107,10 @@ function createSectionsEditor({style, onTitleChanged}) {
|
||||||
if (available <= 0) {
|
if (available <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (const section of sections) {
|
const cmHeights = sections.map(s => s.cm.getWrapperElement().offsetHeight);
|
||||||
const cmHeight = section.cm.getWrapperElement().offsetHeight;
|
sections.forEach((section, i) => {
|
||||||
section.cm.setSize(null, cmHeight + Math.floor(available / sections.length));
|
section.cm.setSize(null, cmHeights[i] + Math.floor(available / sections.length));
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function genId() {
|
function genId() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user