Description
A clear and concise description of what the bug is.
How to Reproduce
Steps to reproduce the behavior:
- Go to https://swap.cow.fi/
- Switch to mobile mode (screen width <960px)
- Click Network Selector
- Click Network Selector again
Actual behavior
Network Selection closes and opens again
Expected behavior
Network Selection should be closed on Network Selector click (4)
Additional context
It works fine on desktop.
It happens because of useOnClickOutside(isUpToMedium ? [nodeMobile] : [node]. On mobile we detect (4) click as "outside" click, so it closes FlyoutMenu. And opens it again because of "onClick" triggers "toggle".