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
Bruno Windels 2019-01-15 12:56:48 +01:00
parent aa90e9591a
commit 3c7bed97ac
1 changed files with 10 additions and 2 deletions

View File

@ -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() {