@@ -1051,6 +1051,40 @@ test("Test string editor inplaceEditForValues without Creator", (): any => {
1051
1051
expect ( q0 . otherText ) . toEqual ( "Other changed" ) ;
1052
1052
} ) ;
1053
1053
1054
+ test ( "Test string editor description clear (with EOL)" , ( ) : any => {
1055
+ const survey = new SurveyModel ( {
1056
+ "pages" : [
1057
+ {
1058
+ "name" : "page1" ,
1059
+ "elements" : [
1060
+ {
1061
+ "type" : "radiogroup" ,
1062
+ "title" : "title" ,
1063
+ "description" : "desc" ,
1064
+ "name" : "q0" ,
1065
+ "choices" : [ "i1" , "i2" ]
1066
+ }
1067
+ ]
1068
+ }
1069
+ ]
1070
+ } ) ;
1071
+
1072
+ const q0 = survey . getQuestionByName ( "q0" ) ;
1073
+ const itemValue = q0 . choices [ 0 ] ;
1074
+ var seChoice = new StringEditorViewModelBase ( itemValue . locText ) ;
1075
+ var seDescription = new StringEditorViewModelBase ( q0 . locDescription ) ;
1076
+ expect ( itemValue . text ) . toEqual ( "i1" ) ;
1077
+ seChoice . onBlur ( { target : { innerText : "new\nTitle" , innerHTML : "new\nTitle" , setAttribute : ( ) => { } , removeAttribute : ( ) => { } } } ) ;
1078
+ expect ( itemValue . text ) . toEqual ( "newTitle" ) ;
1079
+
1080
+ expect ( q0 . description ) . toEqual ( "desc" ) ;
1081
+ seDescription . onBlur ( { target : { innerText : "new\nDesc" , innerHTML : "new\nDesc" , setAttribute : ( ) => { } , removeAttribute : ( ) => { } } } ) ;
1082
+ expect ( q0 . locDescription . text ) . toEqual ( "new\nDesc" ) ;
1083
+
1084
+ seDescription . onBlur ( { target : { innerText : "\n" , innerHTML : "\n" , setAttribute : ( ) => { } , removeAttribute : ( ) => { } } } ) ;
1085
+ expect ( q0 . locDescription . text ) . toEqual ( "" ) ;
1086
+ } ) ;
1087
+
1054
1088
test ( "StringEditor multiline paste for selectbase questions should respect creator.maximumChoicesCount" , ( ) : any => {
1055
1089
const creator = new CreatorTester ( ) ;
1056
1090
creator . maximumChoicesCount = 4 ;
0 commit comments