File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
src/components/form-inputs/dropdown Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -1558,9 +1558,13 @@ var Dropdown = function (_DropdownBase2) {
15581558 } , {
15591559 key : 'valueChanged' ,
15601560 value : function valueChanged ( val ) {
1561- if ( this . multiple === true && this . selectedItems . toString ( ) != val . toString ( ) ) {
1562- this . sui ( 'set exactly' , val ) ;
1563- } else this . sui ( 'set selected' , val ) ;
1561+ if ( val === null || val === undefined ) {
1562+ this . sui ( 'clear' ) ;
1563+ } else {
1564+ if ( this . multiple === true && this . selectedItems . toString ( ) != val . toString ( ) ) {
1565+ this . sui ( 'set exactly' , val ) ;
1566+ } else this . sui ( 'set selected' , val ) ;
1567+ }
15641568 }
15651569 } , {
15661570 key : 'sui' ,
Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ export class Dropdown extends _DropdownBase {
5959 self . selectedItems . splice ( self . selectedItems . indexOf ( val ) , 1 ) ;
6060 }
6161 } ) ;
62-
62+
6363
6464 // make up data validate attr
65- Util . setDataValidateAttr ( this , $ ( this . $el ) . find ( 'input' ) )
65+ Util . setDataValidateAttr ( this , $ ( this . $el ) . find ( 'input' ) )
6666
6767 // assign selected values
6868 this . valueChanged ( this . value )
@@ -71,11 +71,14 @@ export class Dropdown extends _DropdownBase {
7171
7272 @Watch ( 'value' )
7373 valueChanged ( val ) {
74-
75- if ( this . multiple === true && this . selectedItems . toString ( ) != val . toString ( ) ) {
76- this . sui ( 'set exactly' , val ) ;
77- } else
78- this . sui ( 'set selected' , val ) ;
74+ if ( val === null || val === undefined ) {
75+ this . sui ( 'clear' )
76+ } else {
77+ if ( this . multiple === true && this . selectedItems . toString ( ) != val . toString ( ) ) {
78+ this . sui ( 'set exactly' , val ) ;
79+ } else
80+ this . sui ( 'set selected' , val ) ;
81+ }
7982 }
8083
8184 sui ( arg1 ?, arg2 ?) {
You can’t perform that action at this time.
0 commit comments