-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Trigger accounts/contracts search on search input change #2838
Conversation
@@ -27,6 +27,18 @@ | |||
width: 500px !important; | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference purposes: TeamWertarbyte/material-ui-chip-input#20 may be relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. In fact it's implemented, but not in the docs...
@@ -125,54 +125,56 @@ export default class ActionbarSearch extends Component { | |||
handleTokenAdd = (value) => { | |||
const { tokens } = this.props; | |||
|
|||
const newSearchValues = uniq([].concat(tokens, value)); | |||
const newSearchTokens = uniq([].concat(tokens, value)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tokens.concat(value)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just in case tokens isn't really an Array
, but I guess that's taken care of by the PropTypes
Object
} | ||
|
||
handleTokenDelete = (value) => { | ||
const { tokens } = this.props; | ||
|
||
const newSearchValues = [] | ||
const newSearchTokens = [] | ||
.concat(tokens) | ||
.filter(v => v !== value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newSearchTokens = tokens.filter((v) => v !== value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
const newSearchValues = uniq([].concat(searchValues, token)); | ||
this.setState({ searchValues: newSearchValues }); | ||
const { searchTokens } = this.state; | ||
const newSearchTokens = uniq([].concat(searchTokens, token)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searchValues.concat(token)
?
const newSearchValues = uniq([].concat(searchValues, token)); | ||
this.setState({ searchValues: newSearchValues }); | ||
const { searchTokens } = this.state; | ||
const newSearchTokens = uniq([].concat(searchTokens, token)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searchValues.concat(token)
?
const newSearchValues = uniq([].concat(searchValues, token)); | ||
this.setState({ searchValues: newSearchValues }); | ||
const { searchTokens } = this.state; | ||
const newSearchTokens = uniq([].concat(searchTokens, token)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searchValues.concat(token)
?
|
||
const newSearchTokens = [] | ||
.concat(searchTokens || tokens) | ||
.filter(v => v.length > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newSearchTokens = (searchTokens || tokens).filter(v => v.length > 0)
?
The behaviour (not having to press |
Fixes #2766
Triggers the search in the Accounts/Contracts list views whenever the input changes
Adds a new token to the search with
enter
,space
andcomma
Re-styling of the search tokens