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

Filter criteria not shown when typing error #829 #831

Merged
merged 1 commit into from
Jun 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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