1
0
mirror of https://github.com/morris/vanilla-todo.git synced 2025-08-23 22:24:39 +02:00

fix issues with custom list height calc

This commit is contained in:
Morris Brodersen
2023-11-19 13:30:14 +01:00
parent 6930416e4d
commit b279225a3a
4 changed files with 17 additions and 9 deletions

View File

@@ -118,14 +118,18 @@ export function TodoFrameCustom(el) {
const container = el.querySelector('.container');
for (let i = 0, l = container.children.length; i < l; ++i) {
container.children[i].style.height = `auto`;
height = Math.max(container.children[i].offsetHeight, height);
}
el.style.height = `${height + 50}px`;
el.style.height = `${height + 80}px`;
for (let i = 0, l = container.children.length; i < l; ++i) {
container.children[i].style.height = `${height}px`;
container.children[i].style.height = `${height + 30}px`;
}
// update collapsible on changing heights
el.dispatchEvent(new CustomEvent('collapse', { bubbles: true }));
}
function getLists() {