-
Notifications
You must be signed in to change notification settings - Fork 192
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
feat: close Wallet dropdown when clicking outside the component container #925
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
documentation
Improvements or additions to documentation
pkg: wallet
labels
Jul 29, 2024
cpcramer
changed the title
wip
🚧 Close Wallet component when clicking outside component + dropdown
Jul 29, 2024
cpcramer
force-pushed
the
paul/click-to-close-dropdown
branch
from
August 2, 2024 19:14
2d78fe0
to
bfd8921
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
cpcramer
changed the title
🚧 Close Wallet component when clicking outside component + dropdown
Close Wallet component when clicking outside component + dropdown
Aug 2, 2024
cpcramer
changed the title
Close Wallet component when clicking outside component + dropdown
feat: Close Wallet component when clicking outside component container
Aug 2, 2024
cpcramer
changed the title
feat: Close Wallet component when clicking outside component container
feat: Close Wallet dropdown when clicking outside component container
Aug 2, 2024
cpcramer
changed the title
feat: Close Wallet dropdown when clicking outside component container
feat: Close Wallet dropdown when clicking outside the component container
Aug 2, 2024
cpcramer
force-pushed
the
paul/click-to-close-dropdown
branch
from
August 2, 2024 22:00
e2e8f5a
to
3073007
Compare
cpcramer
force-pushed
the
paul/click-to-close-dropdown
branch
from
August 2, 2024 23:04
135e01a
to
999d0fa
Compare
cpcramer
force-pushed
the
paul/click-to-close-dropdown
branch
from
August 2, 2024 23:19
999d0fa
to
0c8801c
Compare
cpcramer
force-pushed
the
paul/click-to-close-dropdown
branch
from
August 2, 2024 23:22
0c8801c
to
ecb628d
Compare
cpcramer
force-pushed
the
paul/click-to-close-dropdown
branch
from
August 2, 2024 23:23
ecb628d
to
afc1742
Compare
cpcramer
changed the title
feat: Close Wallet dropdown when clicking outside the component container
feat: close Wallet dropdown when clicking outside the component container
Aug 3, 2024
Zizzamia
reviewed
Aug 5, 2024
expect(mockSetIsOpen).toHaveBeenCalledWith(false); | ||
}); | ||
|
||
it('should not close the wallet when clicking inside', () => { |
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.
Niiice
Zizzamia
reviewed
Aug 5, 2024
}); | ||
|
||
it('should remove event listener on unmount', () => { | ||
const removeEventListenerSpy = vi.spyOn(document, 'removeEventListener'); |
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.
neat!!!
Zizzamia
approved these changes
Aug 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed? Why?
Add Wallet container ref and click event listener. Close the wallet dropdown when the user clicks outside of the wallet + wallet dropdown container if the dropdown is active!
Functionality recording:
https://www.loom.com/share/e51e2e6b1838499b86dc257c1d543f76
Notes to reviewers
How has it been tested?