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

BTable Checked State is cleared on Back navigation but the Checkbox is visually checked. #3329

Closed
markovejnovic opened this issue May 13, 2021 · 2 comments · Fixed by #3330
Closed

Comments

@markovejnovic
Copy link
Contributor

Overview of the problem

Buefy version: [0.9.7]
Vuejs version: [2.5.17]
OS/Browser: Arch Linux / Chromium 90.0.4430.85 (Official Build) Arch Linux (64-bit)

Description

In an enterprise application that I am working on I have noticed that Checkboxes on the Table component have erroneous output. Upon selecting some rows using the Checkboxes, navigating to a link and then navigating back, the Checkboxes that were previously selected keep their state, however, the checked state is empty.

This article shows the issue is not of Buefy but autocompletion.

Steps to reproduce

  1. Select a couple items.
    After selecting the checkboxes:
    image

This is as expected.

  1. Visit a link on the same page and navigate back to the page with the table.

After navigating to a link and coming back to the same page, the state is cleared (checkedRows.size === 0), but the checkboxes remain visible.

image

Expected behavior

Either the state is updated on Back navigation or the checkboxes are not ticked (which I believe is easier to implement).

I will be making a PR implementing the latter solution.

@jtommy
Copy link
Member

jtommy commented May 13, 2021

Are you using custom-is-checked prop ?

@markovejnovic
Copy link
Contributor Author

markovejnovic commented May 13, 2021

Yes, I am, as so:

// ...
:custom-is-checked="(a, b) => (a.id === b.id)"
// ...

Both of my objects have id keys and they are unique. The issue seems to be one of autocompletion, as I have managed to fix it by forcing autocomplete=off on these checkboxes. I'll be making a PR in a couple minutes with that which might be a bit more insightful.

EDIT: Removed code whitespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants