Skip to content
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

Conversation

YossiSaadi
Copy link
Contributor

onClose and show logic

  • Also fix types for Modal and ModalTopActions to be more specific for each use case

https://monday.monday.com/boards/3532715121/pulses/7368472599

useKeyEvent({
callback: onEscClick,
capture: true,
keys: ["Escape"]
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

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", () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it("does not render when 'show' is false", () => {
it("should not render when 'show' is false", () => {

Copy link
Contributor Author

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 😓

@YossiSaadi YossiSaadi force-pushed the feat/yossi/modal-take-care-of-aria-labelledby-and-aria-describedby-7367625236 branch 2 times, most recently from 7db7139 to d2ba886 Compare September 24, 2024 15:05
Base automatically changed from feat/yossi/modal-take-care-of-aria-labelledby-and-aria-describedby-7367625236 to feat/yossi/new-modal-building-blocks-7359960492 September 24, 2024 15:20
An error occurred while trying to automatically change base from feat/yossi/modal-take-care-of-aria-labelledby-and-aria-describedby-7367625236 to feat/yossi/new-modal-building-blocks-7359960492 September 24, 2024 15:20
@YossiSaadi YossiSaadi force-pushed the feat/yossi/modal-handle-show-and-on-close-logic-7368472599 branch from 4fdff18 to 6d65e90 Compare September 24, 2024 15:51
@YossiSaadi YossiSaadi force-pushed the feat/yossi/modal-handle-show-and-on-close-logic-7368472599 branch from 6d65e90 to 415e639 Compare September 24, 2024 16:06
@YossiSaadi YossiSaadi merged commit 2e0a86d into feat/yossi/new-modal-building-blocks-7359960492 Sep 25, 2024
4 of 6 checks passed
@YossiSaadi YossiSaadi deleted the feat/yossi/modal-handle-show-and-on-close-logic-7368472599 branch September 25, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants