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

When URL sync is active, it requires two click to go back one step #2171

Closed
bobylito opened this issue May 30, 2017 · 2 comments
Closed

When URL sync is active, it requires two click to go back one step #2171

bobylito opened this issue May 30, 2017 · 2 comments

Comments

@bobylito
Copy link
Contributor

Do you want to request a feature or report a bug?
Bug.

Bug: What is the current behaviour?
When click on the browser back button, it requires two click to move back one step. Furthermore, when going back, it seems that we can't go forward (which indicates that we might have a new state that is recorded)

On https://demo.algolia.com/instant-search-demo/, follow these steps:

  • select slowly three brands in the brand refinement list
  • go back once --> goes back right away
  • go back again --> nothing happens
  • go back again --> goes a step back (can't go forward from there)

Bug: What is the expected behaviour?
One click --> one step back and have the ability to go forward.

Bug: What browsers are impacted? Which versions?
tested on chrome, latest.

Bug: What is the proposed solution?
🤷‍♀️

This bug is reproducible in both v1 and v2.

@bobylito
Copy link
Contributor Author

This was introduced when I changed the update of the URL to only happen when there is a search. The problem comes from that we use to rely on change which would not be triggered because of the use of overrideStateWithoutTriggeringChangeEvent. But now we can't prevent the search event from happening.

We need to introduce a new state in the URL sync when the update comes from the URL (eg when popping a state from the history). This way we can prevent the timed out update of the URL from happening.

@bobylito
Copy link
Contributor Author

bobylito commented Jun 6, 2017

The change is the way to go. The fact that URL updates when the searchbox is used with the options searchOnEnterKeyPress is not nice but that's better that any of the bugs introduced with using search instead of the change event.

@bobylito bobylito modified the milestone: 2.0 Jun 7, 2017
bobylito pushed a commit that referenced this issue Jun 7, 2017
This reverts the behaviour of the URL sync to using the `change` event.
Unfortunately it reverts back the state prior to fixing #2105. However
this behavior was introduced on purpose with #1015

Fixes #2173 #2171
bobylito added a commit that referenced this issue Jun 7, 2017
This reverts the behaviour of the URL sync to using the `change` event.
Unfortunately it reverts back the state prior to fixing #2105. However
this behavior was introduced on purpose with #1015

Fixes #2173 #2171
bobylito pushed a commit that referenced this issue Jun 7, 2017
<a name="1.11.13"></a>
## [1.11.13](v1.11.12...v1.11.13) (2017-06-07)

### Bug Fixes

* **url-sync:** reverting back to using `change` event (#2183) ([07f4be0](07f4be0)), closes [#2173](#2173) [#2171](#2171)
@bobylito bobylito closed this as completed Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant