@@ -353,7 +353,7 @@ Future<void> testMain() async {
353
353
// TODO(mdebbar): https://github.com/flutter/flutter/issues/50769
354
354
skip: browserEngine == BrowserEngine .edge);
355
355
356
- test ('Does not trigger input action in multi-line mode' , () {
356
+ test ('Triggers input action in multi-line mode' , () {
357
357
final InputConfiguration config = InputConfiguration (
358
358
inputType: EngineInputType .multiline,
359
359
inputAction: 'TextInputAction.done' ,
@@ -373,8 +373,8 @@ Future<void> testMain() async {
373
373
keyCode: _kReturnKeyCode,
374
374
);
375
375
376
- // Still no input action.
377
- expect (lastInputAction, isNull );
376
+ // Input action is triggered!
377
+ expect (lastInputAction, 'TextInputAction.done' );
378
378
// And default behavior of keyboard event shouldn't have been prevented.
379
379
expect (event.defaultPrevented, isFalse);
380
380
});
@@ -1903,7 +1903,7 @@ Future<void> testMain() async {
1903
1903
// TODO(mdebbar): https://github.com/flutter/flutter/issues/50769
1904
1904
skip: browserEngine == BrowserEngine .edge);
1905
1905
1906
- test ('does not send input action in multi-line mode' , () {
1906
+ test ('sends input action in multi-line mode' , () {
1907
1907
showKeyboard (
1908
1908
inputType: 'multiline' ,
1909
1909
inputAction: 'TextInputAction.next' ,
@@ -1915,8 +1915,14 @@ Future<void> testMain() async {
1915
1915
keyCode: _kReturnKeyCode,
1916
1916
);
1917
1917
1918
- // No input action and no platform message have been sent.
1919
- expect (spy.messages, isEmpty);
1918
+ // Input action is sent as a platform message.
1919
+ expect (spy.messages, hasLength (1 ));
1920
+ expect (spy.messages[0 ].channel, 'flutter/textinput' );
1921
+ expect (spy.messages[0 ].methodName, 'TextInputClient.performAction' );
1922
+ expect (
1923
+ spy.messages[0 ].methodArguments,
1924
+ < dynamic > [clientId, 'TextInputAction.next' ],
1925
+ );
1920
1926
// And default behavior of keyboard event shouldn't have been prevented.
1921
1927
expect (event.defaultPrevented, isFalse);
1922
1928
});
0 commit comments