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

add beforetoggle events #68

Merged
merged 2 commits into from
Jan 26, 2023
Merged

add beforetoggle events #68

merged 2 commits into from
Jan 26, 2023

Conversation

keithamus
Copy link
Collaborator

Description

This PR adds the beforetoggle event which is defined by the spec: https://whatpr.org/html/8221/popover.html#show-popover. It also exposes the global BeforeToggleEvent which is a new Event subclass that is exposed on window.

The beforetoggle event has two properties: currentState and newState. They are set to 'open' or 'closed' based on the current and desired state of the popover. The beforetoggle event when showing a popover is cancelable. The event when hiding a popover is not cancelable. This event does not bubble.

Steps to test/reproduce

I've added tests for each of these conditions. Check out events.spec.ts

REMEMBER: Attach this PR to the Trello card

@keithamus
Copy link
Collaborator Author

I've also added the 0.0.8 version commit, so once merged this can be published as such.

@keithamus keithamus force-pushed the add-beforetoggle-events branch 2 times, most recently from 59554d5 to 72ec2e6 Compare January 26, 2023 15:44
@keithamus keithamus force-pushed the add-beforetoggle-events branch from 72ec2e6 to a110af2 Compare January 26, 2023 15:47
Copy link
Member

@jgerigmeyer jgerigmeyer left a comment

Choose a reason for hiding this comment

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

Looks great! 🚀

@jgerigmeyer jgerigmeyer merged commit e7c20d6 into main Jan 26, 2023
@jgerigmeyer jgerigmeyer deleted the add-beforetoggle-events branch January 26, 2023 16:21
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