Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Merge pull request #831 from metasfresh/dev-829
Browse files Browse the repository at this point in the history
Filter criteria not shown when typing error #829
  • Loading branch information
damianprzygodzki authored Jun 2, 2017
2 parents 20b5da6 + 96b3924 commit 1283ce4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/components/widget/Lookup/Lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class Lookup extends Component {
}
initialFocus={index===0 ? initialFocus : false}
setNextProperty={this.setNextProperty}
lookupEmpty={isInputEmpty}
{...{placeholder, readonly, tabIndex,
windowType, parameterName, entity, dataId,
isModal, recent, rank, updated, filterWidget,
Expand Down
16 changes: 6 additions & 10 deletions src/components/widget/Lookup/RawLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RawLookup extends Component {

const {
autoFocus, defaultValue, fireClickOutside, handleInputEmptyStatus,
filterWidget, initialFocus
filterWidget, initialFocus, lookupEmpty
} = this.props;

const {shouldBeFocused} = this.state;
Expand Down Expand Up @@ -79,7 +79,7 @@ class RawLookup extends Component {
}
}

if(filterWidget && defaultValue === null){
if(filterWidget && defaultValue === null && lookupEmpty){
this.inputSearch.value = defaultValue;
}
}
Expand Down Expand Up @@ -132,20 +132,17 @@ class RawLookup extends Component {
});
}

handleFocus = () => {
this.setState({
isOpen: true
})
}

handleChange = (handleChangeOnFocus) => {
const {
recent, windowType, dataId, filterWidget, parameterName,
tabId, rowId, entity, subentity, subentityId, viewId, mainProperty
tabId, rowId, entity, subentity, subentityId, viewId, mainProperty,
handleInputEmptyStatus
} = this.props;

if(this.inputSearch.value != ''){

handleInputEmptyStatus(false);

this.setState({
isInputEmpty: false,
loading: true,
Expand Down Expand Up @@ -316,7 +313,6 @@ class RawLookup extends Component {
type="text"
className="input-field js-input-field font-weight-semibold"
onChange={this.handleChange}
onFocus={this.handleFocus}
ref={(c) => this.inputSearch = c}
placeholder={placeholder}
disabled={readonly && !disabled}
Expand Down

0 comments on commit 1283ce4

Please sign in to comment.