DataTable does not honor initial selection #1269
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
This is a repost of #1111 with a codesandbox repro.
I'm submitting a ... (check one with "x")
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
The text was updated successfully, but these errors were encountered: