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

Item insert in a oneOf does not work #3910

Closed
jma opened this issue May 8, 2024 · 4 comments
Closed

Item insert in a oneOf does not work #3910

jma opened this issue May 8, 2024 · 4 comments
Labels

Comments

@jma
Copy link

jma commented May 8, 2024

Description
When an array contains a oneOf, inserting a new item loose some model values.

Minimal Reproduction

https://stackblitz.com/edit/angular-bet62l-gnrner?file=src%2Fapp%2Fapp.component.ts

Inserting an item after the first array item loose the last item model value. It seems that inserting an item will hide and show the followers which reset the model. More over the new inserted item has the wrong select value in the oneOf.

Many Thanks in advance.

@jma jma added the bug label May 8, 2024
@aitboudad
Copy link
Member

aitboudad commented May 9, 2024

Hi, I didn't catch the issue in your example
Could you please provide the steps todo in order to reproduce it with expected vs current result?

Thanks!

@jma
Copy link
Author

jma commented May 12, 2024

Basically, if you run my example, you will see two value in the first array 1 and 2. If you click on the "plus" button on the first item of the array, which means "instert a new item after" the value model of the last element "2" is lost.

@aitboudad
Copy link
Member

Got it now, so the expected result is: :[{"entity":1},null,{"entity":2}], instead of :[{"entity":1},null,{}],

@aitboudad
Copy link
Member

This issue has been fixed and released as part of v6.3.1 release.

Please let us know, in case you are still encountering a similar issue/problem.
Thank you!

kawaja pushed a commit to kawaja/ngx-formly that referenced this issue May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants