Fix result propagation in RenderSliverEdgeInsetsPadding.hitTestChildren (#149825)
Fixes https://github.com/flutter/flutter/issues/149824
This commit is contained in:
parent
cfa7777f7a
commit
348fdeebb3
@ -181,7 +181,7 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
|
||||
bool hitTestChildren(SliverHitTestResult result, { required double mainAxisPosition, required double crossAxisPosition }) {
|
||||
if (child != null && child!.geometry!.hitTestExtent > 0.0) {
|
||||
final SliverPhysicalParentData childParentData = child!.parentData! as SliverPhysicalParentData;
|
||||
result.addWithAxisOffset(
|
||||
return result.addWithAxisOffset(
|
||||
mainAxisPosition: mainAxisPosition,
|
||||
crossAxisPosition: crossAxisPosition,
|
||||
mainAxisOffset: childMainAxisPosition(child!),
|
||||
|
@ -185,6 +185,7 @@ void main() {
|
||||
expect(result.path.first.target, isA<RenderView>());
|
||||
result = tester.hitTestOnBinding(const Offset(100.0, 100.0));
|
||||
hitsText(result, 'padded');
|
||||
expect(result.path.any((HitTestEntry entry) => entry.target is RenderSliverPadding), isTrue);
|
||||
result = tester.hitTestOnBinding(const Offset(100.0, 490.0));
|
||||
expect(result.path.first.target, isA<RenderView>());
|
||||
result = tester.hitTestOnBinding(const Offset(10.0, 520.0));
|
||||
|
Loading…
x
Reference in New Issue
Block a user