Demonstrate issue where SuperTextFieldInspector.findScrollOffset() value is incorrect#2256
Conversation
…out of sync on mobile
|
cc/ @matthew-carroll |
SuperTextFieldInspector.findScrollOffset() value is incorrect
|
I see that you added a number of expectations. I assume they all fail? What values are each of them reporting? |
|
@CillianMyles ping on the earlier review questions |
CillianMyles
left a comment
There was a problem hiding this comment.
Apologies for the delay in getting back to you on this one!
I added some information around what happens in the tests + values you were looking for.
| // Since the scrollable content is taller than the viewport, and since | ||
| // the bottom of the text field is aligned with the bottom of the | ||
| // viewport, the scroll offset should be greater than 0. | ||
| expect(SuperTextFieldInspector.findScrollOffset(), greaterThan(0.0)); |
There was a problem hiding this comment.
Part of the test:
testWidgetsOnMobile("multi-line is vertically scrollable when text spans more lines than maxLines", (tester) async {And for both Android and iOS, the test fails because the value for SuperTextFieldInspector.findScrollOffset() is 0
| // Issue is not present on desktop, further leading me to think that the | ||
| // issue is somehow related to that comment about the scroll offsets | ||
| // being out of sync in the mobile scroll view. | ||
| expect(SuperTextFieldInspector.findScrollOffset(), greaterThan(0.0)); |
There was a problem hiding this comment.
Desktop equivalents pass (so the value is > 0)
There was a problem hiding this comment.
Printed the actual value here as 20, which makes sense considering we have a scrollable of height 40 with content of height 60
|
@CillianMyles I ran into this issue while working on https://github.com/superlistapp/super_editor/issues/2316, but I'm not sure if it's the same issue you are facing. It seems that sometimes the |
|
@angelosilvestre I assigned this to you so that you can dig further into the root cause after we decide what to do about restoring the scroll offset. |
As requested in a previous PR: https://github.com/superlistapp/super_editor/pull/2139#discussion_r1717331822
This PR demonstrates that the value of
SuperTextFieldInspector.findScrollOffset()is incorrect sometimes after vertical scrolling on mobile.I guess maybe this comment might contain a clue:
https://github.com/superlistapp/super_editor/blob/main/super_editor/lib/src/super_textfield/infrastructure/text_scrollview.dart#L523-L537