You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similarly to the issues described in #101 there seems to be no good way to consider content size of the view presented in the drawer for it's partially expanded state (as well as for fully expanded).
I've tried to solve that by adopting DrawerPresentable and return the content size from its heightOfPartiallyExpandedDrawer like this:
This seems to work visually without issues but internally the state of the drawer changes and it is not in the partially expanded state because during transition the value returned by this method changes from 0 to final value (for some reason it changes one more time adding 4 pixels, but that's probably for reasons unrelated to DrawerKit) and as a result drawer is in the transitioning state, which breaks interactions with background view a they are only considering "final" states (collapsed, partially expanded and fully expanded).
One fix for that might be to consider transition state while detecting touches, but that does not seem like a solution of underlying problem.
The text was updated successfully, but these errors were encountered:
pre-calculate the content size when creating the view controller (Bento allows to do that using it's Box type) using initial content
observing changes in the content to recalculate the size
return calculated content size value from heightOfPartiallyExpandedDrawer property of the view controller
observe changes of the content size and on each change call drawerPresentationController?.setDrawerState(.partiallyExpanded) to update the state of the drawer and force it to recalculate its geometry based on the new content size
While it works and seems a sensible approach (even though it might be not optimal to calculate size additionally every time content changes) it still would be nice to have a support for that kind of behaviour out of the box, also for fully expanded state, as this approach only works for partially expanded state.
Update: making the same approach to work for fully expanded behaviour is much more tricky and is not possible without DrawerKit changing to allow mutating drawer configuration on the presentation controller, or changing the expanded behaviour from being fixed in the configuration to being computed the same way as partially expanded height (implemented with #103)
Similarly to the issues described in #101 there seems to be no good way to consider content size of the view presented in the drawer for it's partially expanded state (as well as for fully expanded).
I've tried to solve that by adopting
DrawerPresentable
and return the content size from itsheightOfPartiallyExpandedDrawer
like this:This seems to work visually without issues but internally the state of the drawer changes and it is not in the partially expanded state because during transition the value returned by this method changes from 0 to final value (for some reason it changes one more time adding 4 pixels, but that's probably for reasons unrelated to DrawerKit) and as a result drawer is in the
transitioning
state, which breaks interactions with background view a they are only considering "final" states (collapsed, partially expanded and fully expanded).One fix for that might be to consider transition state while detecting touches, but that does not seem like a solution of underlying problem.
The text was updated successfully, but these errors were encountered: