-
-
Notifications
You must be signed in to change notification settings - Fork 832
Conversation
otherwise it just grows with max-height
…and shrink from there
as mouseup can't be detected outside of viewport
- move some methods to ResizeItem subclass - allow distributor to instanciate sizer and resizeitem it needs through static factory methods, instead of passing in another ctor a distributor can only function with the right item and sizer anyways. - use consistent import/export style - remove obsolete code
reshuffle file structure to make more sense
Marked as not ready because Matthew pointed out a few issues that need further investigation. |
Investigated and decided to not fix these now as it would be some work. Filed element-hq/element-web#8125 to track the work left. |
ah, just tested with empty sublists and clearing localstorage, it's broken, need to fix. |
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.
Should be fixed now, by sizing all items to their rendered size on first click |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to look right, albeit complicated. I've highlighted mostly minor things.
Co-Authored-By: bwindels <bruno@windels.cloud>
Co-Authored-By: bwindels <bruno@windels.cloud>
Co-Authored-By: bwindels <bruno@windels.cloud>
Co-Authored-By: bwindels <bruno@windels.cloud>
element-hq/element-web#8055
Changes the room sublist resizing in two ways:
removes the "lock to show all items" behaviour in place up till now (once an item is sized past it's content size, it gets a higher priority to not show a scrollbar), as multiple large locked items couldn't be resized properly anymore.
when a room sublist reaches it min size (header + 1 room tile) or max size (size to have no scrollbar), start shrinking/growing the previous item so the resize action flows over to the item before it, ... giving less the feeling that an item is blocked at it's min or max size.
flex-basis
set to0
instead ofauto
), resulting in less jumpiness while resizing when space gets tight.Code-wise, the concept of a ResizeItem was introduced to easily go from one item to the next for the overflowing behaviour, calling callbacks, ...
As a cleanup, instead of passing the constructors for the
Distributor
(sizing algorithm), theSizer
(dom interactions for sizing/measuring) andResizeItem
, the distributor creates the instances of the helper classes it needs through static methods and only its constructor is passed in.