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(dialog): improve api with modal attribute (VIV-1657) #1853

Merged
merged 11 commits into from
Jul 24, 2024

Conversation

RichardHelm
Copy link
Contributor

@RichardHelm RichardHelm commented Jul 17, 2024

  • Adds modal attribute
  • Adds open event
  • Adds v-model for open

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d61b119) to head (eab39f6).
Report is 1035 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main     #1853     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files          123       342    +219     
  Lines         1562      6211   +4649     
  Branches       108       781    +673     
===========================================
+ Hits          1562      6211   +4649     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -64,18 +55,12 @@ function renderDismissButton(buttonTag: string) {
}

function handleEscapeKey(dialog: Dialog, event: Event) {
if ((event as KeyboardEvent).key === 'Escape' && dialog.modal) {
if ((event as KeyboardEvent).key === 'Escape' && dialog._openedAsModal) {
dialog.open = false;
Copy link
Contributor

@TaylorJ76 TaylorJ76 Jul 23, 2024

Choose a reason for hiding this comment

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

Should we stop the propagation of the event here to stop it affecting other components that are listening for an escape key event?
For example, if the modal markup was inside an open side drawer component for some reason, pressing escape would close the side drawer as well as the modal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TaylorJ76 Yes, but that would not really be related to the modal feature.
Also, we need to do it for all other components.
I created a new ticket for it: https://jira.vonage.com/browse/VIV-1950

@RichardHelm RichardHelm enabled auto-merge (squash) July 24, 2024 13:27
@RichardHelm RichardHelm merged commit daf06bc into main Jul 24, 2024
14 checks passed
@RichardHelm RichardHelm deleted the VIV-1657-improve-dialog-api branch July 24, 2024 13:36
@github-actions github-actions bot mentioned this pull request Jul 24, 2024
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