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

Angular: Empty master-detail list is not updating when replacing data array #1667

Closed
ttntrifork opened this issue Dec 14, 2020 · 2 comments · Fixed by #1671
Closed

Angular: Empty master-detail list is not updating when replacing data array #1667

ttntrifork opened this issue Dec 14, 2020 · 2 comments · Fixed by #1671
Milestone

Comments

@ttntrifork
Copy link

Describe the bug
Empty master-detail list is not updating itself when the data array is being replaced using jsonFormsService.updateCore(Actions.update, ...).
The master-detail list will only update when it is forced to redraw itself from browser window being resized or when adding another entry through the master-detail control itself.

See https://spectrum.chat/jsonforms/general/angular-empty-master-detail-list-not-updating~76ad2d65-d1df-426c-bf6e-00f00ea6c6eb

To Reproduce

  1. Clone https://github.com/ttntrifork/jsonforms-angular-seed
  2. ng serve
  3. Delete all entries in the master-detail list using the UI (delete icon)
  4. Click Import data button

Expected behavior
The master-detail list updates to show the content of the new data array

Browser
Chrome 87.0.4280.88

@ttntrifork
Copy link
Author

I ran into another problem with the master-detail list:
Calling jsonFormsAngularService.setReadonly(true) disables a master-detail component, but calling jsonFormsAngularService.setReadonly(false) afterwards only enables the master list controls, not the nested details controls.

I have pushed a demonstration of this to the same fork.
See ttntrifork/jsonforms-angular-seed@5220039

To Reproduce

  1. Clone https://github.com/ttntrifork/jsonforms-angular-seed
  2. ng serve
  3. Check the Read Only checkbox
  4. Uncheck the Read Only checkbox

Expected behavior
The nested details controls should be re-enabled when unchecking the Read Only checkbox

@sdirix
Copy link
Member

sdirix commented Dec 16, 2020

Thanks for reporting these issues!

eneufeld added a commit to eneufeld/jsonforms that referenced this issue Dec 23, 2020
When the data array of the list master detail renderer is empty,
then changing the data does not rerender the ui.
To fix this the changeDetector is manually triggered.
This error can only be reproduced in the seed,
not from the dev environment.
Furthermore the readonly handling was fixed.

Fix eclipsesource#1667
@sdirix sdirix added this to the 2.5.0 milestone Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants