Browse Source

Add role presentation if the table has no entries

Dustin Utecht 1 year ago
parent
commit
97f3a68e0d
1 changed files with 3 additions and 0 deletions
  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
     // show no records
     if (!hasTr) {
     if (!hasTr) {
       this.$body.html(`<tr class="no-records-found">${Utils.sprintf('<td colspan="%s">%s</td>',
       this.$body.html(`<tr class="no-records-found">${Utils.sprintf('<td colspan="%s">%s</td>',
         this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options),
         this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options),
         this.options.formatNoMatches())}</tr>`)
         this.options.formatNoMatches())}</tr>`)
+      this.$el.attr('role', 'presentation')
     } else if (!this.options.virtualScroll) {
     } else if (!this.options.virtualScroll) {
       this.$body.html(trFragments)
       this.$body.html(trFragments)
     } else {
     } else {