-
Notifications
You must be signed in to change notification settings - Fork 7
Add "toggle" event to Dropdown, Popover, Menu, and Tooltip #589
Conversation
🦋 Changeset detectedLatest commit: 9a60323 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
88db43e
to
95d5c61
Compare
614ea01
to
7645777
Compare
--- | ||
|
||
- Dropdown, Menu, Popover, Split Button, and Tooltip now dispatch a "toggle" event when opened and closed. | ||
- Accordion's "toggle" event is now composed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discovered while working on this that Split Button's "toggle" event wasn't in the Actions tab. The reason was that it comes from Menu, and Menu's "toggle" event wasn't composed.
So I figured that was a decent reason to diverge from native and make it composed. I updated Accordion to match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only remaining event of ours that's not composed is "change". Native doesn't compose it for historical reasons.
But it's always felt awkward to me that we dispatch both "change" and "input" events—yet only "input" traverses shadow roots. I wonder if it's not time to compose "change" as well as a followup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's not time to compose "change" as well as a followup.
You have my vote
7645777
to
2e0d8a7
Compare
expect(event.bubbles).to.be.true; | ||
}); | ||
|
||
it('does not allow "toggle" to propagate', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment explaining why.
3f47c41
to
6e314fb
Compare
6e314fb
to
9a60323
Compare
--- | ||
|
||
- Dropdown, Menu, Popover, Split Button, and Tooltip now dispatch a "toggle" event when opened and closed. | ||
- Accordion's "toggle" event is now composed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's not time to compose "change" as well as a followup.
You have my vote
🚀 Description
From #587:
📋 Checklist
🔬 How to Test
"toggle"
event in the Actions tab.📸 Images/Videos of Functionality
N/A