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

Expanded fieldset get closed when "Add new" button is clicked. #292

Closed
TheJosean opened this issue Aug 20, 2020 · 2 comments
Closed

Expanded fieldset get closed when "Add new" button is clicked. #292

TheJosean opened this issue Aug 20, 2020 · 2 comments

Comments

@TheJosean
Copy link

TheJosean commented Aug 20, 2020

Hi,

First of all, thanks for that code. It saves me a lot of time.

My issue (which happens also in playground) is when i click on + button to add a new array element, the expanded fieldset is closed (with - button does not happen). That only happens when the array item has an other array item inside.

This is an example of the full JSON, for playground, I'm trying to use.

{"schema":{"type":"object","properties":{"config":{"type":"object","title":"config","properties":{"steps":{"title":"steps","type":"array","items":{"type":"object","title":"steps","properties":{"category":{"title":"category","type":"array","items":{"type":"object","title":"categories","properties":{"name":{"type":"string","title":"name"},"subcategory":{"type":"object","title":"subcategory","properties":{"name":{"type":"string","title":"name"}}}}}}}}}}}}},"form":[{"expandable":true,"title":"config","type":"fieldset","items":[{"expandable":true,"title":"steps","type":"fieldset","items":[{"expandable":true,"type":"array","title":"steps","items":[{"expandable":true,"type":"fieldset","title":"{{idx}}","items":[{"expandable":true,"title":"category","type":"fieldset","items":[{"expandable":true,"type":"array","title":"category","items":[{"expandable":true,"type":"fieldset","title":"{{idx}}","items":[{"title":"name","type":"section","items":[{"key":"config.steps[].category[].name"}]},{"expandable":true,"title":"subcategory","type":"fieldset","items":[{"title":"name","type":"section","items":[{"key":"config.steps[].category[].subcategory.name"}]}]}]}]}]}]}]}]}]}]}

Please tell me if I'm doing something wrong.

Thanks in advance.

JA.

@tchapi
Copy link
Member

tchapi commented Aug 27, 2020

Hi

This behaviour has been kind of introduced by #233. I think that 08eb83f fixes that, making sure that we always look at children of the current node before collapsing an expandable item.

Let me know if that works for you
Thanks !

@tchapi tchapi closed this as completed Aug 27, 2020
@TheJosean
Copy link
Author

Hi,

Now works perfect, thank you very much @tchapi for your time and work on this.

JA.

piorek94 pushed a commit to piorek94/jsonform that referenced this issue Jan 3, 2022
… Fix for jsonform#292: only hide expanded in children;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants