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

[MdTable] Reactive Selection requires next tick after data loaded #1866

Closed
FossPrime opened this issue Jul 19, 2018 · 5 comments
Closed

[MdTable] Reactive Selection requires next tick after data loaded #1866

FossPrime opened this issue Jul 19, 2018 · 5 comments
Labels

Comments

@FossPrime
Copy link
Contributor

FossPrime commented Jul 19, 2018

Steps to reproduce

  1. Load table data and selected at the same time asynchronously

Which browser?

Chrome Stable

What is expected?

Selected options should be selected

What is actually happening?

Selected options don't appear

Reproduction Link

Case 1: Update at same time
https://codesandbox.io/s/lp7117wylq

Case 2: Give selection AOT
https://codesandbox.io/s/6j7n78mz6z

@Samuell1
Copy link
Member

Can you test this with dev branch? There was some changes to this merged.

@VdustR
Copy link
Member

VdustR commented Jul 20, 2018

I think I can't fix that due to Vue's lifecycle.
Table get the value on the row created.
Do you have any idea?

@VdustR VdustR added the wontfix label Jul 24, 2018
@VdustR VdustR closed this as completed Jul 24, 2018
FossPrime pushed a commit to FossPrime/vue-mater that referenced this issue Jul 24, 2018
The current implementation couldn't handle selection data and table data at the same time vuematerial#1866
@FossPrime
Copy link
Contributor Author

FossPrime commented Jul 24, 2018

@VdustR The codesandbox example works normally with the pull request. I updated it two handle the AOT case, which is actually an issue in my project, where I have selection data before table data, as the selection is stored in the main collection, while the table's data is in a secondary collection.

@VdustR VdustR added bug and removed wontfix labels Jul 24, 2018
@VdustR
Copy link
Member

VdustR commented Jul 24, 2018

@rayfoss great!

@VdustR VdustR reopened this Jul 24, 2018
Samuell1 pushed a commit that referenced this issue Jul 26, 2018
* comp(mdTable): nextTick selection data

The current implementation couldn't handle selection data and table data at the same time #1866

* comp(MdTable): also handle case #2 AOT

providing selection data Ahead of Time, aka, ahead of table data, will also break MdTable. This handles both cases.

* comp(MdTable): remove redundant nextTick

* comp(MdTable): merge glitch fix
@FossPrime
Copy link
Contributor Author

This bug also prevents onSelect from firing until something is unselected. I updated the Sandbox to show that. Even after the patch, the md-select event is extremely unreliable

https://codesandbox.io/s/6j7n78mz6z

-- We need more tests

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