Skip to content

BTable: sort direction icons are not set properly when using no-local-sorting and sortKey #6602

@paulgv

Description

@paulgv

Describe the bug

When rendering a BTable with no-local-sorting and custom sort keys defined as sortKey in the fields array, the sorting direction icons are not set properly in the table header.

Steps to reproduce the bug

  1. Create a basic BTable which receives sorted items. At least one field should have a custom sortKey, and no-local-sorting should be set.
  2. Try sorting by one of the fields that have a custom sortKey.
  3. Notice how sorting direction icons are not updated in the header.

Expected behavior

The sorting direction icons should be properly updated, regardless of whether the field defined a custom sortKey or not.

Versions

Libraries:

  • BootstrapVue: 2.21.2
  • Bootstrap: 4.5.3
  • Vue: 2.6.12

Demo link

Here's a small repro: https://jsfiddle.net/paulgv/4u19v80o/
When sorting by first name or age, everything seems to be working properly because those fields are not using a custom sortKey. However, notice how sorting by last name does result in the items sorting being updated properly, but the icon in the Last name header is not updated.

Additional context

Custom sortKey Default sort key
Screen Shot 2021-05-06 at 9 59 16 AM Screen Shot 2021-05-06 at 9 59 36 AM

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