Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
LongCatIsLooong committed Nov 21, 2024
1 parent e14b808 commit 1bf0f5c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ui/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class SemanticsAction {

/// A request to scroll the scrollable container to a given scroll offset.
///
/// The payload of this [SemanticsAction] is a flutter-stanard-encoded
/// The payload of this [SemanticsAction] is a flutter-standard-encoded
/// [Float64List] of length 2 containing the target horizontal and vertical
/// offsets (in logical pixels) the receiving scrollable container should
/// scroll to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ - (void)setContentOffset:(CGPoint)contentOffset {
return;
}

double offsetData[2] = {contentOffset.x, contentOffset.y};
double offset[2] = {contentOffset.x, contentOffset.y};
FlutterStandardTypedData* offsetData = [FlutterStandardTypedData
typedDataWithFloat64:[NSData dataWithBytes:&offsetData length:sizeof(offsetData)]];
typedDataWithFloat64:[NSData dataWithBytes:&offset length:sizeof(offset)]];
NSData* encoded = [[FlutterStandardMessageCodec sharedInstance] encode:offsetData];
self.semanticsObject.bridge->DispatchSemanticsAction(
self.semanticsObject.uid, flutter::SemanticsAction::kScrollToOffset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "flutter/fml/macros.h"
#include "flutter/fml/memory/weak_ptr.h"
#include "flutter/lib/ui/semantics/semantics_node.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterSemanticsScrollView.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_ios.h"

constexpr int32_t kRootNodeId = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ - (void)accessibilityBridgeDidFinishUpdate {
// contentOffset is 0.0, only the scroll down action is available.
self.scrollView.frame = self.accessibilityFrame;
self.scrollView.contentSize = [self contentSizeInternal];
// See the documentation on `isDoingSystemScrolling`.
if (!self.scrollView.isDoingSystemScrolling) {
[self.scrollView setContentOffset:self.contentOffsetInternal animated:NO];
}
Expand Down

0 comments on commit 1bf0f5c

Please sign in to comment.