File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1434
1434
titleNotAppended = ! this . selectpicker . view . titleOption . parentNode ,
1435
1435
selectedIndex = element . selectedIndex ,
1436
1436
selectedOption = element . options [ selectedIndex ] ,
1437
- navigation = window . performance && window . performance . getEntriesByType ( 'navigation' ) ;
1437
+ navigation = window . performance && window . performance . getEntriesByType ( 'navigation' ) ,
1438
+ // Safari doesn't support getEntriesByType('navigation') - fall back to performance.navigation
1439
+ isNotBackForward = ( navigation && navigation . length ) ? navigation [ 0 ] . type !== 'back_forward' : window . performance . navigation . type !== 2 ;
1438
1440
1439
1441
if ( titleNotAppended ) {
1440
1442
// Use native JS to prepend option (faster)
1454
1456
// Set selected *after* appending to select,
1455
1457
// otherwise the option doesn't get selected in IE
1456
1458
// set using selectedIndex, as setting the selected attr to true here doesn't work in IE11
1457
- if ( selectTitleOption && navigation . length && navigation [ 0 ] . type !== 'back_forward' ) {
1459
+ if ( selectTitleOption && isNotBackForward ) {
1458
1460
element . selectedIndex = 0 ;
1459
1461
} else if ( document . readyState !== 'complete' ) {
1460
1462
// if navigation type is back_forward, there's a chance the select will have its value set by BFCache
You can’t perform that action at this time.
0 commit comments