commit
ade2788d33
1 changed files with 5 additions and 3 deletions
|
@ -50,7 +50,7 @@ class WunderBar extends React.PureComponent {
|
||||||
this._resetOnNextBlur = hasQuery;
|
this._resetOnNextBlur = hasQuery;
|
||||||
this._isSearchDispatchPending = false;
|
this._isSearchDispatchPending = false;
|
||||||
if (searchQuery) {
|
if (searchQuery) {
|
||||||
this.props.onSearch(searchQuery);
|
this.props.onSearch(searchQuery.trim());
|
||||||
}
|
}
|
||||||
}, WunderBar.TYPING_TIMEOUT); // 800ms delay, tweak for faster/slower
|
}, WunderBar.TYPING_TIMEOUT); // 800ms delay, tweak for faster/slower
|
||||||
}
|
}
|
||||||
|
@ -125,12 +125,14 @@ class WunderBar extends React.PureComponent {
|
||||||
this._resetOnNextBlur = false;
|
this._resetOnNextBlur = false;
|
||||||
clearTimeout(this._userTypingTimer);
|
clearTimeout(this._userTypingTimer);
|
||||||
|
|
||||||
|
const value = this._input.value.trim();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
uri = lbryuri.normalize(this._input.value);
|
uri = lbryuri.normalize(value);
|
||||||
this.setState({ value: uri });
|
this.setState({ value: uri });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//then it's not a valid URL, so let's search
|
//then it's not a valid URL, so let's search
|
||||||
uri = this._input.value;
|
uri = value;
|
||||||
method = "onSearch";
|
method = "onSearch";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue