[iOSTextInput] remove floating cursor asserts (flutter/engine#28868)
This commit is contained in:
@@ -1368,7 +1368,6 @@ static FlutterAutofillType autofillTypeOf(NSDictionary* configuration) {
|
||||
// It seems impossible to use a negative "width" or "height", as the "convertRect"
|
||||
// call always turns a CGRect's negative dimensions into non-negative values, e.g.,
|
||||
// (1, 2, -3, -4) would become (-2, -2, 3, 4).
|
||||
NSAssert(!_isFloatingCursorActive, @"Another floating cursor is currently active.");
|
||||
_isFloatingCursorActive = true;
|
||||
[self.textInputDelegate updateFloatingCursor:FlutterFloatingCursorDragStateStart
|
||||
withClient:_textInputClient
|
||||
@@ -1376,16 +1375,13 @@ static FlutterAutofillType autofillTypeOf(NSDictionary* configuration) {
|
||||
}
|
||||
|
||||
- (void)updateFloatingCursorAtPoint:(CGPoint)point {
|
||||
NSAssert(_isFloatingCursorActive,
|
||||
@"updateFloatingCursorAtPoint is called without an active floating cursor.");
|
||||
_isFloatingCursorActive = true;
|
||||
[self.textInputDelegate updateFloatingCursor:FlutterFloatingCursorDragStateUpdate
|
||||
withClient:_textInputClient
|
||||
withPosition:@{@"X" : @(point.x), @"Y" : @(point.y)}];
|
||||
}
|
||||
|
||||
- (void)endFloatingCursor {
|
||||
NSAssert(_isFloatingCursorActive,
|
||||
@"endFloatingCursor is called without an active floating cursor.");
|
||||
_isFloatingCursorActive = false;
|
||||
[self.textInputDelegate updateFloatingCursor:FlutterFloatingCursorDragStateEnd
|
||||
withClient:_textInputClient
|
||||
|
||||
@@ -825,6 +825,16 @@ FLUTTER_ASSERT_ARC
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testFloatingCursorDoesNotThrow {
|
||||
// The keyboard implementation may send unbalanced calls to the input view.
|
||||
FlutterTextInputView* inputView = [[FlutterTextInputView alloc] init];
|
||||
[inputView beginFloatingCursorAtPoint:CGPointMake(123, 321)];
|
||||
[inputView beginFloatingCursorAtPoint:CGPointMake(123, 321)];
|
||||
[inputView endFloatingCursor];
|
||||
[inputView beginFloatingCursorAtPoint:CGPointMake(123, 321)];
|
||||
[inputView endFloatingCursor];
|
||||
}
|
||||
|
||||
- (void)testBoundsForFloatingCursor {
|
||||
FlutterTextInputView* inputView = [[FlutterTextInputView alloc] init];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user