fix(useMouchAndTouchTracker): add refs to effect deps
What:
- Closes https://github.com/downshift-js/downshift/issues/1600
Why: this ensures mouse and touch tracker effect is always up to date with its refs bindings.
How: added a dependency to a useEffect
Checklist:
- [ ] Documentation N/A
- [ ] Tests N/A
- [ ] TypeScript Types N/A
- [ ] Flow Types N/A
- [ ] Ready to be merged
Thank you for the PR, will take a look!
@silviuaavram Any update on this one?
Looked at it and I would try to avoid adding and removing event listeners on every render. I would propose this one instead.
https://github.com/downshift-js/downshift/pull/1612
@aliceHendicott @seedy could you confirm the fix, please? It should be available as 9.0.7-alpha.1, once we are good to go I will release 9.0.7 with the fix. Thank you!
Actually just go for 9.0.7-alpha.2.
Hey @silviuaavram, thanks for getting an alpha release out. I forked @aliceHendicott's example and upgraded to 9.0.7-alpha.2, but it didn't fix the issue. This is my new sandbox for your reference. 🙏
https://github.com/downshift-js/downshift/assets/72391865/c7b5e252-15d7-4e00-b037-cad7ea17d47c
Thanks for the sandbox! Will let you know once I get some updates on this one.
Still looking into how to do it without adding and removing the handlers on each render. Will update on the progress.
Hi @silviuaavram 👀 wonder if there's any updates for this?
9.0.7-alpha.3
@SL-23 let me know if it works now. @aliceHendicott
Hey @silviuaavram it works now. Thank you so much!