Skip to content

Commit

Permalink
fix(Select): can re select in AutoComplete. close #1199
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon committed Oct 9, 2019
1 parent 38fed47 commit 2814be4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/select/auto-complete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ class AutoComplete extends Base {

handleMenuSelect(keys) {
const key = keys[0];
if (this.state.value === keys[0]) {
return this.setVisible(false, 'itemClick');
}

const mapDS = this.dataStore.getMapDS();

Expand Down
2 changes: 1 addition & 1 deletion src/select/base.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export default class Base extends React.Component {
const value = this.state.value;
let selectedKeys;

if (isNull(value) || value.length === 0) {
if (isNull(value) || value.length === 0 || this.isAutoComplete) {
selectedKeys = [];
} else if (isSingle(mode)) {
selectedKeys = [valueToSelectKey(value)];
Expand Down
2 changes: 1 addition & 1 deletion src/select/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Children } from 'react';
* @return {boolean} is single mode
*/
export function isSingle(mode) {
return !mode || mode === 'single' || mode === 'combobox';
return !mode || mode === 'single';
}

/**
Expand Down

0 comments on commit 2814be4

Please sign in to comment.