-
Notifications
You must be signed in to change notification settings - Fork 39
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
@nstudio/nativescript-checkbox: Toggle is being called twice when binding the checked to an attribute. #132
Labels
Comments
leftundersun
changed the title
Toggle is being called twice when binding the checked to an attribute.
@nstudio/nativescript-checkbox: Toggle is being called twice when binding the checked to an attribute.
May 17, 2023
Hi @leftundersun check out this sample: Although it's shown in Angular you can adapt to Vue this way (feel free to adjust Vue syntax as needed): <check-box
v-for="(option, index) in options"
:key="index"
:text="option"
:checked="checkboxValue"
@checkedChange="checkedChange"
@loaded="checkboxLoaded"
boxType="circle"
fontSize="20"
ios:fillColor="#fff"
onTintColor="#007A42"
/>
checkbox: CheckBox;
checkboxValue: boolean;
checkboxLoaded(e) {
this.checkbox = e.object;
}
checkedChange() {
if (this.checkbox) {
this.checkboxValue = this.checkbox.checked;
console.log('Checkbox value:', this.checkbox.checked);
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you make it this way:
and click on an already selected option, you became able to select another one.
The text was updated successfully, but these errors were encountered: