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

DataTable does not honor initial selection #1269

Closed
harveylee opened this issue May 19, 2021 · 0 comments
Closed

DataTable does not honor initial selection #1269

harveylee opened this issue May 19, 2021 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@harveylee
Copy link
Contributor

This is a repost of #1111 with a codesandbox repro.

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

CodeSandbox Case (Bug Reports)
Please demonstrate your case at CodeSandbox by using the issue template below. Issues without a test case have much less possibility to be reviewed in detail and assisted.

https://codesandbox.io/s/admiring-hugle-3os5s

Current behavior
When using v-model:selection="selectedItems" to bind a Vue ref to the data table selection, the data table is not created with any selection even if selectedItems is populated.

Expected behavior
The data table reflects the selected item when it is created.

Minimal reproduction of the problem with instructions
https://codesandbox.io/s/admiring-hugle-3os5s

What is the motivation / use case for changing the behavior?
I have a panel containing a data table that opens and closes; every time the panel closes the selection is lost, even though the selection state is tracked via a global reactive state object.

Please tell us about your environment:
Windows 10, VS Code, Yarn 1, Vite 2

  • Vue version: 3.X
    3.0.11-beta.3

  • PrimeVue version: 3.4.X
    3.5.0

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    Chrome Version 90.0.4430.212 (Official Build) (64-bit) running on Windows 10 21H1 19043

@cagataycivici cagataycivici self-assigned this Jun 11, 2021
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jun 11, 2021
@cagataycivici cagataycivici added this to the 3.5.1 milestone Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants