Trying to use USWDS modal. Works if I don't pass argument to on method, doesn't work if I do #5390
-
|
I'm playing around with USWDS's modal. Here's some example markup: Here's the Angular component code: If I do it that way, we get this result, everything works: But now let's add this: And our function will do this instead: In this case, where I pass markup to the on function, the modal will open, but the buttons in the modal no longer do anything. Or instead of using the "dan-wrap" div, do this: This will give the same failing result. USWDS version 2.14.0. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
|
Again, not an Angular guy, but Iβve also had quite a few issues with the USWDS modals. Iβd suggest first taking a look at the following Angular USWDS Implementation as it has a modal: https://github.com/GSA/ngx-uswds. If that doesnβt help, review the other implementations here: https://designsystem.digital.gov/documentation/implementations/. And if that doesnβt work, maybe take a look at our React implementation here for some inspiration: https://github.com/MetroStar/comet/tree/main/packages/comet-uswds/src/components/modal. Best of luck! |
Beta Was this translation helpful? Give feedback.
-
|
@dajones537 There was some work done when USWDS 3 was released. Are you seeing the same issues with the current version 3.5.0? |
Beta Was this translation helpful? Give feedback.
-
I decided to create my own modal service instead of using uswds' modals, so I'll close this out. Thanks. |
Beta Was this translation helpful? Give feedback.
Thanks for the feedback. Since posting this I've refactored my modal service to not use uswds's modal functionality. That said, I would be curious to see what happens under new uswds version, so I'll return to this and experiment later. EDIT: won't bother experimenting since I've moved away from doing this in the first place