From 0ae310b871ffa6119a8a8387666964015a0b7753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Tue, 13 Apr 2021 19:39:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84wc-option;=E4=BC=98=E5=8C=96r?= =?UTF-8?q?adio=E5=92=8Ccheckbox=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/form/checkbox-item.wc | 2 +- src/form/dropdown.wc | 82 +++++++++----------------- src/form/option.wc | 118 ++++++++++++++++++++++++++++++++++++++ src/form/radio-item.wc | 2 +- 4 files changed, 146 insertions(+), 58 deletions(-) create mode 100644 src/form/option.wc diff --git a/src/form/checkbox-item.wc b/src/form/checkbox-item.wc index 463f66c..9e62865 100644 --- a/src/form/checkbox-item.wc +++ b/src/form/checkbox-item.wc @@ -253,7 +253,7 @@ export default class Checkbox { this._checkGroup() this._handlClick = $.bind(this, 'click', ev => { - ev.preventDefault() + ev.stopPropagation() this._toggleCheck() }) diff --git a/src/form/dropdown.wc b/src/form/dropdown.wc index d0b9fb3..bbd099d 100644 --- a/src/form/dropdown.wc +++ b/src/form/dropdown.wc @@ -4,19 +4,11 @@ - - +
+ + diff --git a/src/form/radio-item.wc b/src/form/radio-item.wc index 21b53c4..1e871a5 100644 --- a/src/form/radio-item.wc +++ b/src/form/radio-item.wc @@ -239,7 +239,7 @@ export default class Radio { } this._handleClick = $.catch(this, 'click', ev => { - ev.preventDefault() + ev.stopPropagation() this._toggleCheck() })