FIX: correclty allows to untoggle a fk toggle (#30404)

This commit is contained in:
Joffrey JAFFEUX 2024-12-21 00:55:39 +01:00 committed by GitHub
parent ebb6f1c2d2
commit f392259e3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -8,7 +8,7 @@ export default class FKControlToggle extends Component {
@action
handleInput() {
this.args.field.set(!this.args.value);
this.args.field.set(!this.args.field.value);
}
<template>

View File

@ -31,6 +31,14 @@ module(
await formKit().submit();
assert.deepEqual(data, { foo: true });
await formKit().field("foo").toggle();
assert.form().field("foo").hasValue(false);
await formKit().submit();
assert.deepEqual(data, { foo: false });
});
test("when disabled", async function (assert) {