@@ -403,9 +403,9 @@ class ShellBar extends UI5Element {
403
403
404
404
this . _itemNav . setItemsCallback = items => {
405
405
const newItems = that . _itemsInfo . map ( stateItem => {
406
- const mappingItem = items . filter ( item => {
406
+ const mappingItem = items . find ( item => {
407
407
return item . id === stateItem . id ;
408
- } ) [ 0 ] ;
408
+ } ) ;
409
409
410
410
const clone = JSON . parse ( JSON . stringify ( stateItem ) ) ;
411
411
clone . _tabIndex = mappingItem ? mappingItem . _tabIndex : "-1" ;
@@ -483,7 +483,7 @@ class ShellBar extends UI5Element {
483
483
const width = this . getBoundingClientRect ( ) . width ;
484
484
const breakpoints = ShellBar . FIORI_3_BREAKPOINTS ;
485
485
486
- const size = breakpoints . filter ( bp1 => width < bp1 ) [ 0 ] || ShellBar . FIORI_3_BREAKPOINTS [ ShellBar . FIORI_3_BREAKPOINTS . length - 1 ] ;
486
+ const size = breakpoints . find ( bp1 => width < bp1 ) || ShellBar . FIORI_3_BREAKPOINTS [ ShellBar . FIORI_3_BREAKPOINTS . length - 1 ] ;
487
487
const mappedSize = ShellBar . FIORI_3_BREAKPOINTS_MAP [ size ] ;
488
488
489
489
if ( this . breakpointSize !== mappedSize ) {
@@ -583,11 +583,11 @@ class ShellBar extends UI5Element {
583
583
return 1 ;
584
584
} ) ;
585
585
586
- const focusedItem = items . filter ( item => {
586
+ const focusedItem = items . find ( item => {
587
587
return ( item . classes . indexOf ( "ui5-shellbar-invisible-button" ) === - 1 )
588
588
&& ( item . classes . indexOf ( "ui5-shellbar-overflow-button" ) === - 1 )
589
589
&& ( item . classes . indexOf ( "ui5-shellbar-hidden-button" ) === - 1 ) ;
590
- } ) [ 0 ] ;
590
+ } ) ;
591
591
592
592
return focusedItem ;
593
593
}
@@ -680,9 +680,9 @@ class ShellBar extends UI5Element {
680
680
this . _itemNav . currentIndex = elementIndex ;
681
681
682
682
if ( refItemId ) {
683
- const shellbarItem = this . items . filter ( item => {
683
+ const shellbarItem = this . items . find ( item => {
684
684
return item . shadowRoot . querySelector ( `#${ refItemId } ` ) ;
685
- } ) [ 0 ] ;
685
+ } ) ;
686
686
687
687
const prevented = ! shellbarItem . fireEvent ( "itemClick" , { targetRef : event . target } , true ) ;
688
688
0 commit comments