mirror of https://github.com/vector-im/riot-web
size all items to rendered height when starting drag operation
before, we'd only normalize the sublists that had already been sized manually. As non-sized items still have flex-basis: auto, they would claim all the space, and mixing sized and unsized items would be badly broken. Now, on the first click, all items are sized to their rendered size which means they won't flex anymore, but at least the resizing works this way Another downside is that when resizing while a sublist is collapsed, it's reverted to 100px and if a size had been set before, it's forgotten. No way around this with this approach I'm afraid.pull/21833/head
parent
aa90e9591a
commit
3c7bed97ac
|
@ -111,12 +111,20 @@ export default class RoomSubListDistributor {
|
||||||
start() {
|
start() {
|
||||||
// set all max-height props to the actual height.
|
// set all max-height props to the actual height.
|
||||||
let item = this.item.first();
|
let item = this.item.first();
|
||||||
|
const sizes = [];
|
||||||
while (item) {
|
while (item) {
|
||||||
if (!item.isCollapsed() && item.isSized()) {
|
if (!item.isCollapsed()) {
|
||||||
item.setSize(item.size());
|
sizes.push(item.size());
|
||||||
|
} else {
|
||||||
|
sizes.push(100);
|
||||||
}
|
}
|
||||||
item = item.next();
|
item = item.next();
|
||||||
}
|
}
|
||||||
|
item = this.item.first();
|
||||||
|
sizes.forEach((size) => {
|
||||||
|
item.setSize(size);
|
||||||
|
item = item.next();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
|
|
Loading…
Reference in New Issue