From 9408a6b54440113139819db21fc49c3c4f39fb9a Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Fri, 27 Mar 2020 15:59:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E5=BC=B9=E5=87=BA=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E9=A1=B5=E9=9D=A2=E5=90=91=E4=B8=8B=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DatePicker.tsx | 1 + src/components/DateRangePicker.tsx | 1 + src/components/Select.tsx | 1 + src/renderers/Form/Picker.tsx | 1 + src/renderers/Form/TreeSelect.tsx | 1 + 5 files changed, 5 insertions(+) diff --git a/src/components/DatePicker.tsx b/src/components/DatePicker.tsx index 031495f7e..d50c08523 100644 --- a/src/components/DatePicker.tsx +++ b/src/components/DatePicker.tsx @@ -299,6 +299,7 @@ export class DatePicker extends React.Component { handleKeyPress(e: React.KeyboardEvent) { if (e.key === ' ') { this.handleClick(); + e.preventDefault(); } } diff --git a/src/components/DateRangePicker.tsx b/src/components/DateRangePicker.tsx index 8e1346ffb..5e357c890 100644 --- a/src/components/DateRangePicker.tsx +++ b/src/components/DateRangePicker.tsx @@ -326,6 +326,7 @@ export class DateRangePicker extends React.Component< handleKeyPress(e: React.KeyboardEvent) { if (e.key === ' ') { this.handleClick(); + e.preventDefault(); } } diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 0c5138980..bf2a1aac6 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -491,6 +491,7 @@ export class Select extends React.Component { handleKeyPress(e: React.KeyboardEvent) { if (e.key === ' ') { this.toggle(); + e.preventDefault(); } } diff --git a/src/renderers/Form/Picker.tsx b/src/renderers/Form/Picker.tsx index 5d645c8e3..e4bb9ee66 100644 --- a/src/renderers/Form/Picker.tsx +++ b/src/renderers/Form/Picker.tsx @@ -272,6 +272,7 @@ export default class PickerControl extends React.PureComponent< if (e.key === ' ') { this.open(); + e.preventDefault(); } else if (selectedOptions.length && e.key == 'Backspace') { this.removeItem(selectedOptions.length - 1); } diff --git a/src/renderers/Form/TreeSelect.tsx b/src/renderers/Form/TreeSelect.tsx index 81636dabe..2ccbe21f8 100644 --- a/src/renderers/Form/TreeSelect.tsx +++ b/src/renderers/Form/TreeSelect.tsx @@ -127,6 +127,7 @@ export default class TreeSelectControl extends React.Component< handleKeyPress(e: React.KeyboardEvent) { if (e.key === ' ') { this.handleClick(); + e.preventDefault(); } }