@@ -1060,7 +1060,7 @@ QUnit.module('multi tag support', {
10601060 assert . deepEqual ( $tag . text ( ) , '3 selected' , 'text is correct' ) ;
10611061 } ) ;
10621062
1063- QUnit . test ( 'multi tag should deselect overflow tags only when showMultiTagOnly is false' , function ( assert ) {
1063+ QUnit . test ( 'multi tag remove should deselect all items grouped under it when showMultiTagOnly is false (T1329352) ' , function ( assert ) {
10641064 const $tagBox = $ ( '#tagBox' ) . dxTagBox ( {
10651065 items : [ 1 , 2 , 3 , 4 ] ,
10661066 value : [ 1 , 2 , 4 ] ,
@@ -1069,15 +1069,30 @@ QUnit.module('multi tag support', {
10691069 } ) ;
10701070
10711071 const tagBox = $tagBox . dxTagBox ( 'instance' ) ;
1072- const $multiTag = $tagBox . find ( '.' + TAGBOX_MULTI_TAG_CLASS ) ;
1072+ const $multiTag = $tagBox . find ( `. ${ TAGBOX_MULTI_TAG_CLASS } ` ) ;
10731073
10741074 $ ( $multiTag . find ( `.${ TAGBOX_TAG_REMOVE_BUTTON_CLASS } ` ) ) . trigger ( 'dxclick' ) ;
10751075
1076- assert . equal ( $tagBox . find ( '.' + TAGBOX_TAG_CLASS ) . length , 2 , 'only 2 tags remain' ) ;
1077- assert . deepEqual ( tagBox . option ( 'value' ) , [ 1 , 2 ] , 'value is correct' ) ;
1078- assert . deepEqual ( this . getTexts ( $tagBox . find ( '.' + TAGBOX_TAG_CLASS ) ) , [ '1' , '2' ] , 'tags have correct text' ) ;
1076+ assert . equal ( $tagBox . find ( `.${ TAGBOX_TAG_CLASS } ` ) . length , 1 , 'only the individually rendered tag remains' ) ;
1077+ assert . deepEqual ( tagBox . option ( 'value' ) , [ 1 ] , 'only the value visible as an individual tag remains' ) ;
10791078 } ) ;
10801079
1080+ QUnit . test ( 'multi tag remove should deselect all items when showMultiTagOnly is true (T1329352)' , function ( assert ) {
1081+ const $tagBox = $ ( '#tagBox' ) . dxTagBox ( {
1082+ items : [ 1 , 2 , 3 , 4 ] ,
1083+ value : [ 1 , 2 , 4 ] ,
1084+ maxDisplayedTags : 2 ,
1085+ showMultiTagOnly : true
1086+ } ) ;
1087+
1088+ const tagBox = $tagBox . dxTagBox ( 'instance' ) ;
1089+ const $multiTag = $tagBox . find ( `.${ TAGBOX_MULTI_TAG_CLASS } ` ) ;
1090+
1091+ $ ( $multiTag . find ( `.${ TAGBOX_TAG_REMOVE_BUTTON_CLASS } ` ) ) . trigger ( 'dxclick' ) ;
1092+
1093+ assert . equal ( $tagBox . find ( `.${ TAGBOX_TAG_CLASS } ` ) . length , 0 , 'no tags remain' ) ;
1094+ assert . deepEqual ( tagBox . option ( 'value' ) , [ ] , 'value is cleared' ) ;
1095+ } ) ;
10811096
10821097 QUnit . test ( 'TagBox should preserve reverse click order in leading tag when showMultiTagOnly is false' , function ( assert ) {
10831098 const $tagBox = $ ( '#tagBox' ) . dxTagBox ( {
0 commit comments