Skip to content

Conversation

@IbenTesara
Copy link
Contributor

Adds a forced WCAG/ARIA compliant wrapper around the CDK Dialog.

@IbenTesara IbenTesara added enhancement New feature or request ngx-inform @studiohyperdrive/ngx-inform labels Sep 18, 2024
@IbenTesara IbenTesara added this to the ngx-inform:v18.2.0 milestone Sep 18, 2024
@IbenTesara IbenTesara self-assigned this Sep 18, 2024
/**
* A wrapper service to Angular CDK Dialog that provides a WCAG/ARIA compliant implementation of modals
*
* @export
Copy link
Contributor

Choose a reason for hiding this comment

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

Why document the export? I don't think this is something we've been doing up until now, what are the benefits?

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's been a thing we've started doing in the VLAIO project a while back and it is in line with what Angular does for their services as well.

Other than extra information I don't think there's a major benefit, but I don't see a downside either.

// Iben: Return the modal action
return combineLatest([
// Iben: Set the start value to undefined so both actions at least emit once
modal.action.pipe(startWith(undefined)),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we've discussed this in the past, but just noting that using undefined is only considerd when using ES5+ in strict mode. If not, undefined can be overwritten and this can cause unwanted behaviour.

(Also applies to several other places in this PR)

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 am aware, but given that this is just internal use I don't see an issue here in this specific spot? Unless you can point me to a potential issue here?

For me it's the same as using first vs take(1) in rjxs. As long as you know the difference and you use the correct one in the correct situation, I'm fine with either one if you use it in a situation where they're interchangeable.

@WHeirstrate WHeirstrate merged commit 3d49616 into master Sep 19, 2024
@WHeirstrate WHeirstrate deleted the feat/ngx-inform/modal branch September 19, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ngx-inform @studiohyperdrive/ngx-inform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants