Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialSortBy value is updated when sort order changes. #733

Closed
1 task done
henritoivar opened this issue Jul 15, 2020 · 1 comment
Closed
1 task done

initialSortBy value is updated when sort order changes. #733

henritoivar opened this issue Jul 15, 2020 · 1 comment

Comments

@henritoivar
Copy link

Issue Type (delete the irrelevant ones)

  • Bug
  • [] Enhancement Request
  • [] Question

Specs

What version are you using? 2.19.2

What browser? Chrome

Expected Behavior

What did you expect to happen?
initalSortBy should not be mutated from within VueGoodTable

Actual Behavior

What actually happened?
Whenever i change the sort on VueGoodTable my local variable is updated.

Steps to Reproduce the Problem

Please detail your steps here

 <VueGoodTable
                :columns="columns"
                :rows="invoices"
                @on-row-click="viewInvoice"
                :pagination-options="{
                    setCurrentPage: query.page,
                    perPage: query.limit,
                    enabled: true
                  }"
                :sort-options="{
                    initialSortBy: query.sort
                  }"
                :isLoading.sync="loading"
                :totalRows="total"
                mode="remote"
                @on-page-change="onPageChange"
                @on-sort-change="onSortChange"
                @on-column-filter="onColumnFilter"
                @on-per-page-change="onPerPageChange"
                styleClass="vgt-table condensed"
                class="vgt-table--card"
        />
    </div>
  1. When i change the sort, then my local query.sort object is updated. This should not happen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment