@@ -1048,6 +1048,39 @@ describe('Select.Basic', () => {
1048
1048
expect ( end ) . toBe ( 1 ) ;
1049
1049
expect ( cursorValue ) . toBe ( '1' ) ;
1050
1050
} ) ;
1051
+
1052
+ it ( 'Moving the cursor in TextArea does not display the listbox' , ( ) => {
1053
+ const onKeyDown = jest . fn ( ) ;
1054
+ const onMouseDown = jest . fn ( ) ;
1055
+ const textareaRef = jest . fn ( ) ;
1056
+ const mouseDownPreventDefault = jest . fn ( ) ;
1057
+ const { container } = render (
1058
+ < Select
1059
+ mode = "combobox"
1060
+ value = "abc\ndef"
1061
+ ref = { textareaRef }
1062
+ getInputElement = { ( ) => (
1063
+ < textarea rows = { 3 } onKeyDown = { onKeyDown } onMouseDown = { onMouseDown } />
1064
+ ) }
1065
+ options = { [ { value : 'light' } , { value : 'bamboo' } ] }
1066
+ allowClear
1067
+ /> ,
1068
+ ) ;
1069
+
1070
+ const textareaEle = container . querySelector ( 'textarea' ) ;
1071
+ toggleOpen ( container ) ;
1072
+
1073
+ const mouseDownEvent = createEvent . mouseDown ( textareaEle ) ;
1074
+ mouseDownEvent . preventDefault = mouseDownPreventDefault ;
1075
+ fireEvent ( textareaEle , mouseDownEvent ) ;
1076
+
1077
+ keyDown ( textareaEle , KeyCode . ENTER ) ;
1078
+
1079
+ [ KeyCode . LEFT , KeyCode . DOWN , KeyCode . RIGHT , KeyCode . UP ] . forEach ( ( keyCode ) => {
1080
+ keyDown ( textareaEle , keyCode ) ;
1081
+ expectOpen ( container , false ) ;
1082
+ } ) ;
1083
+ } ) ;
1051
1084
} ) ;
1052
1085
1053
1086
it ( 'getRawInputElement for rc-cascader' , ( ) => {
0 commit comments