ソースを参照

Fixed table border bug when table is hidden (#5033)

Co-authored-by: Dennis Hernández <dennishernandezvargas@gmail.com>
文翼 5 年 前
コミット
872e19098e
1 ファイル変更6 行追加1 行削除
  1. 6 1
      src/bootstrap-table.js

+ 6 - 1
src/bootstrap-table.js

@@ -2662,6 +2662,11 @@ class BootstrapTable {
       this.$tableContainer.css('height', '')
       this.$tableContainer.css('height', '')
       this.$tableContainer.css('width', '')
       this.$tableContainer.css('width', '')
     } else if (this.options.height) {
     } else if (this.options.height) {
+      if (this.$tableBorder) {
+        this.$tableBorder.css('width', '')
+        this.$tableBorder.css('height', '')
+      }
+
       const toolbarHeight = this.$toolbar.outerHeight(true)
       const toolbarHeight = this.$toolbar.outerHeight(true)
       const paginationHeight = this.$pagination.outerHeight(true)
       const paginationHeight = this.$pagination.outerHeight(true)
       const height = this.options.height - toolbarHeight - paginationHeight
       const height = this.options.height - toolbarHeight - paginationHeight
@@ -2669,7 +2674,7 @@ class BootstrapTable {
       const tableHeight = $bodyTable.outerHeight()
       const tableHeight = $bodyTable.outerHeight()
       this.$tableContainer.css('height', `${height}px`)
       this.$tableContainer.css('height', `${height}px`)
 
 
-      if (this.$tableBorder) {
+      if (this.$tableBorder && $bodyTable.is(':visible')) {
         let tableBorderHeight = height - tableHeight - 2
         let tableBorderHeight = height - tableHeight - 2
         if (this.$tableBody[0].scrollWidth - this.$tableBody.innerWidth()) {
         if (this.$tableBody[0].scrollWidth - this.$tableBody.innerWidth()) {
           tableBorderHeight -= Utils.getScrollBarWidth()
           tableBorderHeight -= Utils.getScrollBarWidth()