Skip to content

Commit 12de744

Browse files
committed
fix(validation): on keypress need to validate after setValue
1 parent 5e236eb commit 12de744

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/client/scripts/rb-checkbox.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ export class RbCheckbox extends FormControl(RbBase()) {
9494
this.setValue(value);
9595
await this.validate()
9696
}
97-
_onkeypress(value, evt) { // :void
97+
async _onkeypress(value, evt) { // :void
9898
const keys = ['enter','space'];
9999
const key = this.getKey(evt.code);
100100
if (keys.indexOf(key) === -1) return;
101101
evt.preventDefault(); // prevent space key from moving page down
102102
this.setValue(value);
103+
await this.validate()
103104
this.rb.elms.formControl.checked = this.value; // needed for firefox
104105
}
105106

0 commit comments

Comments
 (0)