File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/components/form-inputs/dropdown Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { _DropdownBase } from './_base';
99export class Dropdown extends _DropdownBase {
1010
1111 selectedItems = undefined
12+ _htmlItems = ''
1213
1314 createComponent ( ch ) {
1415 let css = 'ui selection dropdown'
@@ -20,11 +21,24 @@ export class Dropdown extends _DropdownBase {
2021 ch ( 'input' , { attrs : { type : 'hidden' , name : this . name } } ) ,
2122 ch ( 'i' , { 'class' : 'dropdown icon' } ) ,
2223 ch ( 'div' , { 'class' : 'default text' } , this . placeholder ) ,
23- ch ( 'div' , { 'class' : 'menu' } , this . $slots [ 'default' ] )
24+ ch ( 'div' , { 'class' : 'menu' , 'ref' : 'menu' } , this . $slots [ 'default' ] )
2425 ] )
2526 }
2627
2728
29+ beforeUpdate ( ) {
30+ // store dropdown items state
31+ this . _htmlItems = ( this . $refs [ 'menu' ] as HTMLDivElement ) . innerHTML
32+ }
33+
34+ updated ( ) {
35+ // refresh dropdown when items has been changed
36+ if ( this . _htmlItems !== ( this . $refs [ 'menu' ] as HTMLDivElement ) . innerHTML ) {
37+ this . sui ( 'refresh' )
38+ }
39+ }
40+
41+
2842 mounted ( ) {
2943
3044 var self = this ;
You can’t perform that action at this time.
0 commit comments