@@ -1754,7 +1754,7 @@ function initAutocomplete(config, minisearch) {
1754
1754
}
1755
1755
1756
1756
function initMinisearchAutocomplete ( config ) {
1757
- if ( config . allowedFields && ! config . allowedFields . includes ( 'full' ) ) {
1757
+ if ( config . allowedFields && config . allowedFields . indexOf ( 'full' ) < 0 ) {
1758
1758
return ;
1759
1759
}
1760
1760
@@ -1769,7 +1769,7 @@ function initMinisearchAutocomplete(config) {
1769
1769
1770
1770
initAutocompleteForField ( 'search' , 'full' , config , function ( input , field ) {
1771
1771
var caretPos = input . caret ( ) ;
1772
- if ( ! Number . isInteger ( caretPos ) ) {
1772
+ if ( ! ( typeof caretPos === 'number' ) ) {
1773
1773
console . error ( "Suggest: could not get caret position" ) ;
1774
1774
return ;
1775
1775
}
@@ -1784,7 +1784,7 @@ function initMinisearchAutocomplete(config) {
1784
1784
}
1785
1785
1786
1786
function initAutocompleteForField ( inputId , field , config , dataFunction , errorElemId ) {
1787
- if ( config . allowedFields && ! config . allowedFields . includes ( field ) ) {
1787
+ if ( config . allowedFields && config . allowedFields . indexOf ( field ) < 0 ) {
1788
1788
return ;
1789
1789
}
1790
1790
@@ -1865,7 +1865,7 @@ function initAutocompleteForField(inputId, field, config, dataFunction, errorEle
1865
1865
event . preventDefault ( ) ;
1866
1866
return ;
1867
1867
}
1868
- if ( event . originalEvent . originalEvent . type . startsWith ( 'key' ) ) { // replace value only on key events
1868
+ if ( event . originalEvent . originalEvent . type . indexOf ( 'key' ) == 0 ) { // replace value only on key events
1869
1869
replaceValueWithSuggestion ( input , text , identifier , ui . item . phrase ) ;
1870
1870
}
1871
1871
0 commit comments