Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Revert "[macos] Move TextInputPlugin outside of visible area" #39176

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,8 @@ @implementation FlutterTextInputPlugin {
}

- (instancetype)initWithViewController:(FlutterViewController*)viewController {
// The view needs an empty frame otherwise it is visible on dark background.
// https://github.com/flutter/flutter/issues/118504
self = [super initWithFrame:NSZeroRect];
// The view needs a non-zero frame.
self = [super initWithFrame:NSMakeRect(0, 0, 1, 1)];
if (self != nil) {
_flutterViewController = viewController;
_channel = [FlutterMethodChannel methodChannelWithName:kTextInputChannel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1532,20 +1532,4 @@ - (bool)testSelectorsAreForwardedToFramework {
ASSERT_FALSE(window.firstResponder == viewController.textInputPlugin);
}

TEST(FlutterTextInputPluginTest, HasZeroSize) {
id engineMock = OCMClassMock([FlutterEngine class]);
id binaryMessengerMock = OCMProtocolMock(@protocol(FlutterBinaryMessenger));
OCMStub( // NOLINT(google-objc-avoid-throwing-exception)
[engineMock binaryMessenger])
.andReturn(binaryMessengerMock);
FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:engineMock
nibName:@""
bundle:nil];

FlutterTextInputPlugin* plugin =
[[FlutterTextInputPlugin alloc] initWithViewController:viewController];

ASSERT_TRUE(NSIsEmptyRect(plugin.frame));
}

} // namespace flutter::testing