浏览代码

Add role presentation if the table has no entries

Dustin Utecht 1 年之前
父节点
当前提交
97f3a68e0d
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/bootstrap-table.js

+ 3 - 0
src/bootstrap-table.js

@@ -1804,11 +1804,14 @@ class BootstrapTable {
       }
     }
 
+    this.$el.removeAttr('role')
+
     // show no records
     if (!hasTr) {
       this.$body.html(`<tr class="no-records-found">${Utils.sprintf('<td colspan="%s">%s</td>',
         this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options),
         this.options.formatNoMatches())}</tr>`)
+      this.$el.attr('role', 'presentation')
     } else if (!this.options.virtualScroll) {
       this.$body.html(trFragments)
     } else {