Fix value check. Reset through form caused unexpected value.

This commit is contained in:
trading_peter 2023-08-21 22:54:40 +02:00
parent 6426802d18
commit d58c280433
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@tp/tp-checkbox",
"version": "1.0.6",
"version": "1.0.7",
"description": "",
"main": "tp-checkbox.js",
"scripts": {

View File

@ -32,6 +32,8 @@ class TpCheckbox extends Inert(ControlState(FormElement(LitElement))) {
border-radius: 2px;
width: var(--tp-checkbox-width, 18px);
height: var(--tp-checkbox-height, 18px);
min-width: var(--tp-checkbox-width, 18px);
min-height: var(--tp-checkbox-height, 18px);
}
tp-icon {
@ -111,7 +113,7 @@ class TpCheckbox extends Inert(ControlState(FormElement(LitElement))) {
}
get value() {
if (this._value !== '') {
if (this._value !== '' && this._value !== null && this._value !== undefined) {
return this._value;
}
return this.checked;