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

onChange triggered twice on Checkboxes #36

Open
sinqinc opened this issue Feb 16, 2017 · 1 comment
Open

onChange triggered twice on Checkboxes #36

sinqinc opened this issue Feb 16, 2017 · 1 comment

Comments

@sinqinc
Copy link

sinqinc commented Feb 16, 2017

Hi,

I have a problem with the onChange event with the new decorator with checkboxes. The event is triggered twice every time the form is loaded and twice when a changed is made.

I'm using updateOn: 'blur'; and it's probably what is causing the issue. I had no such problem with the other decorator but the the model doesn't get updated if the input is removed by a condition. Now the model is updated but the "onBlur" and onChange doesn't seems to work well.

`{
 "type" : "objet",
    "properties" : {
	var1: {
        "items" : {
            "enum" : [ 
                "a", 
                "b", 
                "c"
            ],
            "type" : "string"
        },
        "type" : "array",
        "title" : "Oui ou Non 'checkboxes'"
	}
    }
}




options.ngModelOptions={ updateOn: 'blur' };
				 options.onChange = function(modelView, newVal) {
					$timeout(function(){
						debounceUpdate(newVal,modelView);
					})
				};
`
@Anthropic
Copy link
Member

@sinqinc can you try with the latest alpha and let me know if that improves things at all?

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

No branches or pull requests

1 participant