New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix a draggableScrollableSheet's LocalHistoryEntry leaking #110576
Conversation
if (notification.extent > notification.initialExtent) { | ||
if (persistentSheetHistoryEntry == null) { | ||
persistentSheetHistoryEntry = LocalHistoryEntry(onRemove: () { | ||
if (notification.extent > notification.initialExtent) { |
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 condition is always true, right?
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.
It would seem so.. I am out today and will take a closer look a little later. FYI @thkim1011, who is joining us in scrolling land. Tae has been studying the draggable scrollable sheet. :)
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.
@thkim1011 Hi, nice to meet you : )
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.
Actually, wouldn't this be true or false based on the direction (expanding/contracting) the sheet was going in?
if (notification.extent > notification.initialExtent)
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 statement in the scope of onRemove
callback and it should be never changed until it actually called, right?
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.
Line #2189 already ensures that this condition is true.
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.
Oh silly me, I missed that.
Isn't it true that, by definition persistent bottom sheets on |
This is a special case where if the persistent sheet has a draggable widget we should give it a back button for a11y. |
Ok understood. Can the reviewers prioritize it, the issue is giving a bad UX for the end users |
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.
If the persistent bottom sheet is a draggableScrollableSheet and the user expand it, there will be a back button for a11y.
There are two situations that the local history entry may be leaked,
1, When user shrink the sheet we can not remove the entry due to the double calculations precision.
2, We do not remove the route entry when unmount the draggableScrollableSheet widget.
Fixes #110123