-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: NetworkSelect mobile toggle bug #3698
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
Conversation
|
@brunocrosier is attempting to deploy a commit to the Uniswap Team on Vercel. A member of the Team first needs to authorize it. |
|
This pull request is being automatically deployed with Vercel (learn more). widgets – ./🔍 Inspect: https://vercel.com/uniswap/widgets/FNLguSUuBHhBjizmaNyKAFdvNeoB interface – ./🔍 Inspect: https://vercel.com/uniswap/interface/7E6H6yak7SRVovR4icWnkVACbPsm |
| const { urlChain, urlChainId } = getParsedChainId(parsedQs) | ||
| const prevChainId = usePrevious(chainId) | ||
| const node = useRef<HTMLDivElement>() | ||
| const node = useRef<HTMLDivElement>(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Means we no longer need to assert as any
<SelectorWrapper ref={node as any} ... >becomes
<SelectorWrapper ref={node} ... >|
|
||
| return ( | ||
| <SelectorWrapper ref={node as any} onMouseEnter={toggle} onMouseLeave={toggle}> | ||
| <SelectorWrapper ref={node} onMouseEnter={openModal} onMouseLeave={closeModal} onClick={toggle}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why we can't have just do:
<SelectorWrapper ref={node} onMouseEnter={toggle} onMouseLeave={toggle} onClick={toggle}>is that we could end up in this state:
- hover to open
- click to close (at this point, mouse is still hovering over element)
this would mean that when the mouse leaves, the toggle function would be called again, thereby reopening the modal (which is not the desired behaviour)
|
Thanks Bruno! Looks like the Vercel build failed with the below prettier error. Can you fix ? |
|
Hey @willhennessy Hmm that's strange. I was able to run The strange thing is, I didn't make any changes to I think there's a chance you may be looking at a different PR by mistake? I can see that there is another open PR which does modify I have commented that file with a suggested fix here: https://github.com/Uniswap/interface/pull/3693/files#r847601265 Any questions, let me know! |
|
Sorry! You're right, I was reviewing PRs and mixed up the tabs. Great detective work. We're getting an engineer to review the PR asap. Thanks bruno. |
JFrankfurt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should
- drop the package.json changes and add them in a new pr w/ a windows compatible script.
- look into a local compatibility solution (prob git config) for the prettier issue
this change to make the script Windows-compatible will be dealt with in a separate PR
Will be dealt with in a separate PR
|
@zzmp @JFrankfurt Thanks for your comments. I have removed the Windows changes, and will create a separate PR for that! |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
149fced to
0e06c40
Compare

Fixes: [3690]