Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Refinements applied in modal are cleared on close, virtual widget doesn't appear to be working? #1776

Closed
rtman opened this issue Nov 29, 2018 · 3 comments

Comments

@rtman
Copy link

rtman commented Nov 29, 2018

Hi,

So for my web app I want to put our refinements in a modal. I've followed the guide for doing this and still the refinements applied in the modal are cleared when the modal is closed. Maybe I've made a mistake or am using the Virtual Widget incorrectly??

I also notice a significant slowdown when passing searchstate and onSearchStateChanged between the two InstantSearch instances. If I comment out those two props on the 1st instance the slowdown disappears. This effect isn't as noticeable in the codesandbox but in my actual app the slowdown is severe.

Here is my codesandbox illustrating the issue.

https://codesandbox.io/s/3y7kw953ym

@samouss
Copy link
Collaborator

samouss commented Nov 30, 2018

The state of the RefinementList inside the modal is not persisted because the onSearchStateChange callback only apply the current state. Inside our React Native example we do merge the previous and the current state. Here is your example updated.

@rtman
Copy link
Author

rtman commented Nov 30, 2018

Ah ok, I was following another guide from the react-instantsearch docs on your site which doesn't show previous and current state merging. Can you guys update the docs ?

@samouss
Copy link
Collaborator

samouss commented Nov 30, 2018

We are in the process of re-writing the full documentation, this issue will be fixed at that time. Thanks for spotting the issue though!

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

No branches or pull requests

2 participants