Closed pcvonz closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@pcvonz I faced a similar issue. Was this fixed? Or did you find any workaround?
Affected Projects
React Library Version: x.y.z
Working off this commit: e2eacff2275c201a5becea71a58996313c2653df Describe the bug
In
ReactiveBase
in this loop: https://github.com/appbaseio/reactivesearch/blob/e2eacff2275c201a5becea71a58996313c2653df/packages/web/src/components/basic/ReactiveBase.js#L120If
parsedParams.value
is undefined when parsing URLParams, theselectedValue.value
is set to the parsed params. https://github.com/appbaseio/reactivesearch/blob/e2eacff2275c201a5becea71a58996313c2653df/packages/web/src/components/basic/ReactiveBase.js#L127 If parsed params is an Object (which is the case for the CategorySearch component) then this line: https://github.com/appbaseio/reactivesearch/blob/e2eacff2275c201a5becea71a58996313c2653df/packages/web/src/components/search/CategorySearch.js#L158Will cause ReactiveSearch to throw an error. To Reproduce
Steps to reproduce the behavior:
value
from theSearch
object in the URL bar.Expected behavior
Only set
selectedValue
in reactive base ifvalue
is a string.Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
I've run into this bug a few times in my app. Sometimes when using the
back
andforward
buttons.Navigating with back button:
somesearchapp.whatever/?
somesearchapp.whatever/?Search=%7B%22category%22%3A%22%2FRoot%20Catalog%2FDefault%20Category%2FTabletop%22%2C%22value%22%3A%22cup%22%7D
Error being thrown:
TypeError: "this.state.currentValue.trim is not a function"