Skip to content

[b-table] Anonymous filter-function is ignored since version 2.22.0 #6967

Open
@manandre

Description

@manandre

Describe the bug

Any anonymous filter-function passed to a b-table component is ignored since version 2.22.0.
This is working correctly in version 2.21.2.

Steps to reproduce the bug

<template>
  <b>With Named Filter</b>
  <b-table :items="items" :filter="criteria" :filter-function="namedFilter">
  </b-table>
  <b>With Anonymous Filter</b>
  <b-table :items="items" :filter="criteria" :filter-function="anonymousFilterFactory()">
  </b-table>
</template>
<script>
export default {
  data() {
    return {
      anonymousFilterFactory: () => (row, filter) => false,
      namedFilter: (row, filter) => false,
      criteria: "40",
      items: [{
          age: 40,
          first_name: 'Dickerson',
          last_name: 'Macdonald'
        },
        {
          age: 21,
          first_name: 'Larsen',
          last_name: 'Shaw'
        },
        {
          age: 89,
          first_name: 'Geneva',
          last_name: 'Wilson'
        },
        {
          age: 38,
          first_name: 'Jami',
          last_name: 'Carney'
        }
      ]
    }
  }
})
}
</script>

image

Expected behavior

Same result with named or anonymous filter functions

image

Versions

Libraries:

  • BootstrapVue: 2.22.0
  • Bootstrap: 4.6.1
  • Vue: 2.6.12

Environment:

  • Device: PC
  • OS: Win 10 20H2
  • Browser: Chrome
  • Version: 100.0.4896.127

Demo link

CodePen

Additional context

It seems to be a regression introduced by #6345

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy