1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-08 21:42:24 +03:00

create sizer that sets item size with flex-basis

works with the flex-grow we set initially for the sub lists
This commit is contained in:
Bruno Windels
2018-10-18 15:51:22 +02:00
parent a910f46c5b
commit 39ab3d86bd
3 changed files with 11 additions and 3 deletions

View File

@@ -97,4 +97,11 @@ class Sizer {
}
}
module.exports = {Sizer};
class FlexSizer extends Sizer {
setItemSize(item, size) {
item.style.flexGrow = '0';
item.style.flexBasis = `${Math.round(size)}px`;
}
}
module.exports = {Sizer, FlexSizer};