From d58c28043340f10fdc139201ca876f9c38703134 Mon Sep 17 00:00:00 2001 From: pk Date: Mon, 21 Aug 2023 22:54:40 +0200 Subject: [PATCH] Fix value check. Reset through form caused unexpected value. --- package.json | 2 +- tp-checkbox.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7300825..237cfce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-checkbox", - "version": "1.0.6", + "version": "1.0.7", "description": "", "main": "tp-checkbox.js", "scripts": { diff --git a/tp-checkbox.js b/tp-checkbox.js index 9192676..5cf23e9 100644 --- a/tp-checkbox.js +++ b/tp-checkbox.js @@ -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;