File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -477,14 +477,14 @@ export function createControls (that, header) {
477477 if ( Array . isArray ( value ) ) {
478478 for ( let i = 0 ; i < value . length ; i ++ ) {
479479 if ( value [ i ] && value [ i ] . length > 0 && value [ i ] . trim ( ) ) {
480- $selectControl . find ( `option[value="${ value [ i ] } "]` ) . attr ( 'selected' , true )
480+ $selectControl . find ( `option[value="${ value [ i ] } "]` ) . prop ( 'selected' , true )
481481 }
482482 }
483483 } else if ( value && value . length > 0 && value . trim ( ) ) {
484- $selectControl . find ( 'option[ selected] ' ) . removeAttr ( 'selected' )
485- $selectControl . find ( `option[value="${ value } "]` ) . attr ( 'selected' , true )
484+ $selectControl . find ( 'option: selected' ) . prop ( 'selected' , false )
485+ $selectControl . find ( `option[value="${ value } "]` ) . prop ( 'selected' , true )
486486 } else {
487- $selectControl . find ( 'option[ selected] ' ) . removeAttr ( 'selected' )
487+ $selectControl . find ( 'option: selected' ) . prop ( 'selected' , false )
488488 }
489489
490490 clearTimeout ( currentTarget . timeoutId || 0 )
Original file line number Diff line number Diff line change @@ -113,9 +113,9 @@ $.BootstrapTable = class extends $.BootstrapTable {
113113
114114 const top = $ ( window ) . scrollTop ( )
115115 // top anchor scroll position, minus header height
116- const start = this . $stickyBegin . offset ( ) . top - this . options . stickyHeaderOffsetY
116+ const start = this . $stickyBegin ? this . $stickyBegin . offset ( ) . top - this . options . stickyHeaderOffsetY : 0
117117 // bottom anchor scroll position, minus header height, minus sticky height
118- const end = this . $stickyEnd . offset ( ) . top - this . options . stickyHeaderOffsetY - this . $header . height ( )
118+ const end = this . $stickyEnd ? this . $stickyEnd . offset ( ) . top - this . options . stickyHeaderOffsetY - this . $header . height ( ) : 0
119119
120120 // show sticky when top anchor touches header, and when bottom anchor not exceeded
121121 if ( top > start && top <= end ) {
@@ -155,7 +155,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
155155 this . $stickyContainer . html ( this . $stickyTable . append ( this . $stickyHeader ) )
156156 // match clone and source header positions when left-right scroll
157157 this . matchPositionX ( )
158- } else {
158+ } else if ( this . $stickyContainer ) {
159159 this . $stickyContainer . removeClass ( 'fix-sticky' ) . hide ( )
160160 }
161161 }
You can’t perform that action at this time.
0 commit comments