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

Changing query point field adds extra history entry #281

Open
easbar opened this issue Nov 8, 2022 · 1 comment
Open

Changing query point field adds extra history entry #281

easbar opened this issue Nov 8, 2022 · 1 comment

Comments

@easbar
Copy link
Member

easbar commented Nov 8, 2022

When we calculate a route, then clear a field, and then enter another location/point to calculate a new route two history entries are created. One for the empty field and another for the new one. The first one is caused by the InvalidatePoint action. This means that when we click 'back' after the change the route disappears as one field is empty and we need to click 'back' another time to go back to the previous route.

To fix this we need to deal with the fact that this user interaction (changing the input field) triggers two state updates and we create a history entry for every state update. One possibility would be creating history entries explicitly instead of using our current indirect approach.

@karussell
Copy link
Member

karussell commented Nov 9, 2022

Currently we dispatch InvalidatePoint on every keystroke, but probably it makes more sense to call it only if the input looses focus (click elsewhere/tab) or explicit enter with empty string. And then it might be fine to add this explicit action into history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants