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

Fix Topbar search initial value #857

Merged
merged 2 commits into from
Jul 2, 2018
Merged

Fix Topbar search initial value #857

merged 2 commits into from
Jul 2, 2018

Conversation

lyyder
Copy link
Contributor

@lyyder lyyder commented Jun 28, 2018

Fixes showing the searched address in the Topbar search form after a search conducted from the Topbar.

Makes the origin attribute optional in propTypes.place in src/util/types.js as it is not used in case the sortSearchByDistance is not set in config.

@@ -174,7 +174,7 @@ class TopbarComponent extends Component {
);

// Only render current search if full place object is available in the URL params
const locationFieldsPresent = address && origin && bounds && country;
const locationFieldsPresent = address && bounds && country;
Copy link
Contributor

Choose a reason for hiding this comment

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

const originNeedChecked = config.sortSearchByDistance && origin || !config.sortSearchByDistance;
or something like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Gnito updated this, didn't match your proposal but I think the idea is the same.

Require origin to be passed to search input in case search results are
sorted by distance.
@lyyder lyyder merged commit 682629e into master Jul 2, 2018
@lyyder lyyder deleted the topbar-search-value branch July 2, 2018 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants