-
Notifications
You must be signed in to change notification settings - Fork 322
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(Modal): handle onClose and show logic of component #2429
feat(Modal): handle onClose and show logic of component #2429
Conversation
packages/core/src/components/ModalNew/ModalTopActions/ModalTopActions.types.ts
Outdated
Show resolved
Hide resolved
useKeyEvent({ | ||
callback: onEscClick, | ||
capture: true, | ||
keys: ["Escape"] |
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 we have consts for these
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.
Will change for now, but I think we should make useKeyEvent
use string keys as well, same as we switched from static props to inline string props
can be a non-breaking change after we release Vibe3
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.
But it's not type-safe, no?
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.
it can be
we can extract the keys strings from React's TS I believe
@@ -27,6 +28,16 @@ describe("Modal", () => { | |||
expect(getByTestId("modal")).toHaveAttribute("aria-modal", "true"); | |||
}); | |||
|
|||
it("does not render when 'show' is false", () => { |
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.
it("does not render when 'show' is false", () => { | |
it("should not render when 'show' is false", () => { |
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've wrote all the tests not in a should
style (by mistake, accidentally ignored Gebeta's chosen style)
planning on changing all the tests names later 😓
7db7139
to
d2ba886
Compare
…licking Escape clicking on X to close modal has already implemented at earlier commits
it can be either a MouseEvent of clicking a button ("x" close button), clicking on a div (backdrop), or clicking with the keyboard on Escape key
the only case is mouse event when clicking the "x" close button
4fdff18
to
6d65e90
Compare
6d65e90
to
415e639
Compare
2e0a86d
into
feat/yossi/new-modal-building-blocks-7359960492
onClose
andshow
logicModal
andModalTopActions
to be more specific for each use casehttps://monday.monday.com/boards/3532715121/pulses/7368472599