@@ -17,6 +17,7 @@ import EditingPreview, {
1717import {
1818 FOCUSED_STATE_CLASS ,
1919} from '__internal/core/widget/widget' ;
20+ import { shouldSkipOnDesktop , shouldSkipOnMobile } from '../../../helpers/device.js' ;
2021
2122const TEXTEDITOR_INPUT_CLASS = 'dx-texteditor-input' ;
2223
@@ -186,6 +187,10 @@ QUnit.module('MessageBox', moduleConfig, () => {
186187 } ) ;
187188
188189 QUnit . test ( 'should be fired on enter key if the textarea input contains a value' , function ( assert ) {
190+ if ( shouldSkipOnMobile ( assert ) ) {
191+ return ;
192+ }
193+
189194 const onMessageEnteredStub = sinon . stub ( ) ;
190195
191196 this . reinit ( { onMessageEntered : onMessageEnteredStub } ) ;
@@ -283,6 +288,10 @@ QUnit.module('MessageBox', moduleConfig, () => {
283288 } ) ;
284289
285290 QUnit . test ( 'should be fired with correct arguments when enter is pressed' , function ( assert ) {
291+ if ( shouldSkipOnMobile ( assert ) ) {
292+ return ;
293+ }
294+
286295 assert . expect ( 6 ) ;
287296
288297 const text = ' new text message ' ;
@@ -306,6 +315,24 @@ QUnit.module('MessageBox', moduleConfig, () => {
306315 . keyDown ( 'enter' )
307316 . keyUp ( 'enter' ) ;
308317 } ) ;
318+
319+ QUnit . test ( 'should not send message on enter key on mobile devices (T1293840)' , function ( assert ) {
320+ if ( shouldSkipOnDesktop ( assert ) ) {
321+ return ;
322+ }
323+
324+ const onMessageEnteredStub = sinon . stub ( ) ;
325+
326+ this . reinit ( { onMessageEntered : onMessageEnteredStub } ) ;
327+
328+ keyboardMock ( this . $input )
329+ . focus ( )
330+ . type ( 'new text message' )
331+ . keyDown ( 'enter' )
332+ . keyUp ( 'enter' ) ;
333+
334+ assert . strictEqual ( onMessageEnteredStub . callCount , 0 ) ;
335+ } ) ;
309336 } ) ;
310337
311338 QUnit . module ( 'onMessageEditCanceled event' , ( ) => {
@@ -693,6 +720,10 @@ QUnit.module('MessageBox', moduleConfig, () => {
693720 } ) ;
694721
695722 QUnit . test ( 'textarea should be cleared on enter key when some text is entered' , function ( assert ) {
723+ if ( shouldSkipOnMobile ( assert ) ) {
724+ return ;
725+ }
726+
696727 keyboardMock ( this . $input )
697728 . focus ( )
698729 . type ( 'some text' )
@@ -703,6 +734,10 @@ QUnit.module('MessageBox', moduleConfig, () => {
703734 } ) ;
704735
705736 QUnit . test ( 'enter keydown event should be prevented if input text has non-space characters' , function ( assert ) {
737+ if ( shouldSkipOnMobile ( assert ) ) {
738+ return ;
739+ }
740+
706741 const enterKeyDownEvent = $ . Event ( 'keydown' , { key : 'enter' } ) ;
707742
708743 keyboardMock ( this . $input ) . type ( '1' ) ;
@@ -733,6 +768,10 @@ QUnit.module('MessageBox', moduleConfig, () => {
733768 } ) ;
734769
735770 QUnit . test ( 'textarea should restore its height after enter press when multiline text was entered' , function ( assert ) {
771+ if ( shouldSkipOnMobile ( assert ) ) {
772+ return ;
773+ }
774+
736775 const initialTextAreaHeight = this . $textArea . height ( ) ;
737776
738777 keyboardMock ( this . $input )
0 commit comments