Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/improve nav browser title #1800

Closed
wants to merge 3 commits into from
Closed
Changes from 2 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
17 changes: 16 additions & 1 deletion app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ export class BrowserTab extends PureComponent {
this.setState({
url,
inputValue: url,
autocompletInputValue: url,
autocompleteInputValue: url,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo! 🙃

currentPageTitle: title,
forwardEnabled: false
});
Expand Down Expand Up @@ -1604,6 +1604,19 @@ export class BrowserTab extends PureComponent {
this.props.navigation.setParams(params);
};

/**
* reset autocompleteInputValue to be the url if the input has been left empty
*/
resetAutocompleteInputValue = urlParam => {
console.log(urlParam);
rickycodes marked this conversation as resolved.
Show resolved Hide resolved
const { autocompleteInputValue } = this.state;
if (autocompleteInputValue === '') {
this.setState({
autocompleteInputValue: urlParam
});
}
};

hideUrlModal = url => {
const urlParam = typeof url === 'string' && url ? url : this.props.navigation.state.params.url;
this.props.navigation.setParams({
Expand All @@ -1612,6 +1625,8 @@ export class BrowserTab extends PureComponent {
showUrlModal: false
});

this.resetAutocompleteInputValue(urlParam);

if (this.isHomepage()) {
const { current } = this.webview;
const blur = `document.getElementsByClassName('autocomplete-input')[0].blur();`;
Expand Down