@@ -218,7 +218,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
218218 */
219219 ngOnChanges ( changes ) {
220220 if ( changes . items ) {
221- this . view [ "updateList" ] ( changes . items . currentValue ) ;
221+ this . view . items = changes . items . currentValue ;
222222 this . updateSelected ( ) ;
223223 }
224224 }
@@ -254,9 +254,9 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
254254 this . closeDropdown ( ) ;
255255 }
256256 this . selected . emit ( event ) ;
257- this . view [ " filterBy" ] ( "" ) ;
257+ this . view . filterBy ( "" ) ;
258258 } ) ;
259- this . view [ "updateList" ] ( this . items ) ;
259+ this . view . items = this . items ;
260260 // update the rest of combobox with any pre-selected items
261261 // setTimeout just defers the call to the next check cycle
262262 setTimeout ( ( ) => {
@@ -290,7 +290,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
290290 ev . stopPropagation ( ) ;
291291 this . openDropdown ( ) ;
292292 setTimeout ( ( ) => this . view . getCurrentElement ( ) . focus ( ) , 0 ) ;
293- } else if ( ev . key === "ArrowUp" && this . dropdownMenu . nativeElement . contains ( ev . target ) && ! this . view [ " hasPrevElement" ] ( ) ) {
293+ } else if ( ev . key === "ArrowUp" && this . dropdownMenu . nativeElement . contains ( ev . target ) && ! this . view . hasPrevElement ( ) ) {
294294 this . elementRef . nativeElement . querySelector ( ".combobox_input" ) . focus ( ) ;
295295 }
296296 }
@@ -340,7 +340,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
340340 }
341341 return item ;
342342 } ) ;
343- this . view [ "updateList" ] ( this . items ) ;
343+ this . view . items = this . items ;
344344 this . updatePills ( ) ;
345345 // clearSelected can only fire on type=multi
346346 // so we just emit getSelected() (just in case there's any disabled but selected items)
@@ -349,7 +349,6 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
349349
350350 /**
351351 * Closes the dropdown and emits the close event.
352- * @memberof ComboBox
353352 */
354353 public closeDropdown ( ) {
355354 this . open = false ;
@@ -358,15 +357,13 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
358357
359358 /**
360359 * Opens the dropdown.
361- * @memberof ComboBox
362360 */
363361 public openDropdown ( ) {
364362 this . open = true ;
365363 }
366364
367365 /**
368366 * Toggles the dropdown.
369- * @memberof ComboBox
370367 */
371368 public toggleDropdown ( ) {
372369 if ( this . open ) {
@@ -381,7 +378,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
381378 * @param {string } searchString
382379 */
383380 public onSearch ( searchString ) {
384- this . view [ " filterBy" ] ( searchString ) ;
381+ this . view . filterBy ( searchString ) ;
385382 if ( searchString !== "" ) {
386383 this . openDropdown ( ) ;
387384 } else {
@@ -390,7 +387,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
390387 if ( this . type === "single" ) {
391388 // deselect if the input doesn't match the content
392389 // of any given item
393- const matches = this . view . items . some ( item => item . content . toLowerCase ( ) . includes ( searchString . toLowerCase ( ) ) ) ;
390+ const matches = this . view . getListItems ( ) . some ( item => item . content . toLowerCase ( ) . includes ( searchString . toLowerCase ( ) ) ) ;
394391 if ( ! matches ) {
395392 const selected = this . view . getSelected ( ) ;
396393 if ( selected ) {
@@ -399,7 +396,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
399396 this . view . select . emit ( { item : selected [ 0 ] } ) ;
400397 this . propagateChangeCallback ( null ) ;
401398 } else {
402- this . view [ " filterBy" ] ( "" ) ;
399+ this . view . filterBy ( "" ) ;
403400 }
404401 }
405402 }
@@ -421,10 +418,10 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
421418 public onSubmit ( ev ) {
422419 let index = 0 ;
423420 if ( ev . after ) {
424- index = this . view . items . indexOf ( ev . after ) + 1 ;
421+ index = this . view . getListItems ( ) . indexOf ( ev . after ) + 1 ;
425422 }
426423 this . submit . emit ( {
427- items : this . view . items ,
424+ items : this . view . getListItems ( ) ,
428425 index,
429426 value : {
430427 content : ev . value ,
0 commit comments