Skip to content

Add Dialog component#343

Merged
ChronosSF merged 45 commits intomasterfrom
dmdimitrov/dialog-component
Sep 2, 2022
Merged

Add Dialog component#343
ChronosSF merged 45 commits intomasterfrom
dmdimitrov/dialog-component

Conversation

@igdmdimitrov
Copy link
Copy Markdown
Contributor

Closes #175

@igdmdimitrov igdmdimitrov requested a review from simeonoff May 3, 2022 12:00
Copy link
Copy Markdown
Member

@rkaraivanov rkaraivanov left a comment

Choose a reason for hiding this comment

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

@sdimchevski

After some reading up, the first point in the article
caught my attention.

This begs the question what do we render when the dialog is opened in this scenario?

<igc-dialog title="Warning"></igc-dialog>

image

Maybe we should have a default button when no content is provided just to move focus there for easier closing?

@sdimchevski
Copy link
Copy Markdown

@rkaraivanov Yes, dialogs must have at least one focusable control so I think it's a good idea to always have an OK button.

@rkaraivanov rkaraivanov marked this pull request as ready for review August 31, 2022 08:49
Copy link
Copy Markdown
Member

@damyanpetev damyanpetev left a comment

Choose a reason for hiding this comment

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

Outside of a minor nit and a questionable test, LGTM

Comment on lines +48 to +55
expect(dialog).dom.to.have.text(content);
expect(dialog).dom.to.equal(
`
<igc-dialog>
<span>
Dialog content
</span>
</igc-dialog>`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Confused. No way this is actually testing if the dialog has the content since it's not looking in the shadow DOM - so not really checking if the content is inside the dialog for real.
Same line of thinking for the second check - which again tests the light DOM for the very same nodes that were used in createDialogComponent, thus testing if the fixture and native DOM node creation works, kinda pointless.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PS: Tested by deleting the default slot in the dialog, this test still passed :)

<div part="backdrop" aria-hidden="true" ?hidden=${!this.open}></div>
<dialog
part="base"
role="dialog"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that role should be implicit on the native dialog already, so perhaps a bit redundant

@ChronosSF ChronosSF merged commit 90460f1 into master Sep 2, 2022
@ChronosSF ChronosSF deleted the dmdimitrov/dialog-component branch September 2, 2022 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y When the issue or PR is related to accessibility design: verified dialog themes ✅ status: verified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dialog component

9 participants