空格弹出下拉框的时候,组织页面向下滚动

This commit is contained in:
2betop 2020-03-27 15:59:18 +08:00
parent 4b68ed91f6
commit 9408a6b544
5 changed files with 5 additions and 0 deletions

View File

@ -299,6 +299,7 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
handleKeyPress(e: React.KeyboardEvent) {
if (e.key === ' ') {
this.handleClick();
e.preventDefault();
}
}

View File

@ -326,6 +326,7 @@ export class DateRangePicker extends React.Component<
handleKeyPress(e: React.KeyboardEvent) {
if (e.key === ' ') {
this.handleClick();
e.preventDefault();
}
}

View File

@ -491,6 +491,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
handleKeyPress(e: React.KeyboardEvent) {
if (e.key === ' ') {
this.toggle();
e.preventDefault();
}
}

View File

@ -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);
}

View File

@ -127,6 +127,7 @@ export default class TreeSelectControl extends React.Component<
handleKeyPress(e: React.KeyboardEvent) {
if (e.key === ' ') {
this.handleClick();
e.preventDefault();
}
}