Skip to content

Commit

Permalink
fix(Select): should not del item with backspace while disabled.fix al…
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon committed Oct 8, 2019
1 parent 81b0e75 commit 9223875
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/select/select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ class Select extends Base {
mode,
hasClear,
onToggleHighlightItem,
readOnly,
disabled,
} = this.props;

if (popupContent) {
Expand All @@ -554,6 +556,9 @@ class Select extends Base {
break;
case KEYCODE.ENTER:
e.preventDefault();
if (readOnly || disabled) {
break;
}
this.chooseHighlightItem(proxy, e);
break;
case KEYCODE.ESC:
Expand All @@ -565,6 +570,9 @@ class Select extends Base {
!hasSearch && e.preventDefault();
break;
case KEYCODE.BACKSPACE:
if (readOnly || disabled) {
break;
}
if ((mode === 'multiple' && showSearch) || mode === 'tag') {
// 在多选并且有搜索的情况下,删除最后一个 tag
const valueDS = this.valueDataSource.valueDS;
Expand Down

0 comments on commit 9223875

Please sign in to comment.