Skip to content

DestroyStrategy does not trigger when field no longer meets condition #689

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

Closed
Gbiggert opened this issue May 18, 2016 · 10 comments
Closed

Comments

@Gbiggert
Copy link

So I believe that this was addressed in issue #371 and I believe that a solution was purportedly merged however I am still having issues with this problem. So I have noticed that when you select a value which displays a conditional field, pick a value in the resulting conditional, change the value so the field no longer meets the condition (and the conditional field is hidden), and then change back to the previously selected condition, then the conditional field has retained its value. Now my desired functionality would be that upon the failure to meet the condition that the field would be removed and no data would be retained. Am I right in thinking that the current behavior is wrong? Would you have any suggestions as to working around this issue if this is the correct behavior.

Plunker

http://plnkr.co/edit/Yuc849V3BMKt2Ys42Tqo?p=preview

Related issues

#371

@Anthropic
Copy link
Member

Anthropic commented May 25, 2016

@Gbiggert thanks I will try to sort out why once we merge the webpack/babel branch soon. #371 has a comment at the end about splitting to a new directive that we will probably need to look into as well.

@schmidt-uni-leipzig
Copy link

schmidt-uni-leipzig commented Aug 11, 2016

Are there any new information / milestone plans for this issue? Surprisingly, the "Kitchen Sink" example at http://schemaform.io/examples/bootstrap-example.html works fine, but in my implementation, I am not able to automatically clear the model value dependend on a 'condition' expression. I use the lasted release 0.8.13. Thank you for your remarks.

@Anthropic
Copy link
Member

@schmidt-uni-leipzig I am getting closer with the webpack babel code, just got back from a month break so will find time over the next few weeks to start more solid alpha testing to get a beta out.

That said I haven't looked to see why it may work in the demo and not in 0.8.13, could be a PR afterwards has fixed it, I need to get a new release done pretty badly. Would be grateful to hear if you had any luck finding out the difference?

@jimgrimmett
Copy link

Can confirm that the kitchen sink is working but when using the code locally the destroy handlers are not called and the model stays as it was.

Will there be a 0.8.14 bugfix releaseor is the 1.0 release the next we can expect?

@Anthropic
Copy link
Member

@jimgrimmett I've had several reports that the v1.0.0-alpha's are working pretty well for the few people already using them, would love to know if this is still an issue in that, I think the test cases covered it. But nothing beats human verification :)

@MaggieBi
Copy link

MaggieBi commented Feb 23, 2017

Can confirm that this issue is still present with the v1.0.0-alpha, the hidden values are not removed from the model even when destroyStrategy: 'remove'. Any resolution would be much appreciated.

@Anthropic Anthropic added this to the 1.0.0 milestone Apr 3, 2017
Anthropic added a commit that referenced this issue Apr 3, 2017
@Anthropic
Copy link
Member

@MaggieBi I believe this will work as of alpha.4 would love it if you could try with the files in the dist folder of the developer branch

@Anthropic
Copy link
Member

This should be fixed in alpha 4, please re-open if the problem persists.

@jimgrimmett
Copy link

Is there any chance the fixes will be back-ported to the 3.x branch? We're using schema-form in production and are not going to be using an alpha any time soon.

Many thanks.

J.

@Anthropic
Copy link
Member

@jimgrimmett the biggest issue I have is that I am not as familiar with the older codebase (I wasn't maintainer back then) so I am nervous to make changes when the test cases were also not working properly for the 0.x branch. Technically I'd say 0.x is pre-alpha as well as it had many bugs and issues, I would expect the alpha to work much better. But I am hoping to move to beta soon-ish, only a few more features I want to add for v1.

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

No branches or pull requests

5 participants