File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1915,17 +1915,19 @@ the specific language governing permissions and limitations under the Apache Lic
19151915
19161916 this . search . val ( this . focusser . val ( ) ) ;
19171917 }
1918- this . search . focus ( ) ;
1919- // move the cursor to the end after focussing, otherwise it will be at the beginning and
1920- // new text will appear *before* focusser.val()
1921- el = this . search . get ( 0 ) ;
1922- if ( el . createTextRange ) {
1923- range = el . createTextRange ( ) ;
1924- range . collapse ( false ) ;
1925- range . select ( ) ;
1926- } else if ( el . setSelectionRange ) {
1927- len = this . search . val ( ) . length ;
1928- el . setSelectionRange ( len , len ) ;
1918+ if ( this . opts . shouldFocusInput ( this ) ) {
1919+ this . search . focus ( ) ;
1920+ // move the cursor to the end after focussing, otherwise it will be at the beginning and
1921+ // new text will appear *before* focusser.val()
1922+ el = this . search . get ( 0 ) ;
1923+ if ( el . createTextRange ) {
1924+ range = el . createTextRange ( ) ;
1925+ range . collapse ( false ) ;
1926+ range . select ( ) ;
1927+ } else if ( el . setSelectionRange ) {
1928+ len = this . search . val ( ) . length ;
1929+ el . setSelectionRange ( len , len ) ;
1930+ }
19291931 }
19301932
19311933 // initializes search's value with nextSearchTerm (if defined by user)
You can’t perform that action at this time.
0 commit comments