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

Allow events to bubble outside of ShadowDOM #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions delegated-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export function fire(target, name, detail) {
new CustomEvent(name, {
bubbles: true,
cancelable: true,
composed: true,
detail: detail
})
);
Expand Down
1 change: 1 addition & 0 deletions delegated-events.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
type Event = {
bubbles: boolean;
cancelable: boolean;
composed: boolean;
currentTarget: Element;
deepPath?: () => EventTarget[];
defaultPrevented: boolean;
Expand Down
1 change: 1 addition & 0 deletions test/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ import {on, off} from '../delegated-events';
new CustomEvent('test:bench', {
bubbles: true,
cancelable: true,
composed: true,
detail: {index: i}
})
);
Expand Down
2 changes: 2 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('delegated event listeners', function() {
const observer = function(event) {
assert(event.bubbles);
assert(event.cancelable);
assert(event.composed);
assert.equal(event.type, 'test:detail');
assert.deepEqual(event.detail, {id: 42, login: 'hubot'});
assert.strictEqual(document.body, event.target);
Expand Down Expand Up @@ -58,6 +59,7 @@ describe('delegated event listeners', function() {
const observer = function(event) {
assert(event.bubbles);
assert(event.cancelable);
assert(event.composed);
assert.equal(event.type, 'test:on');
assert.deepEqual({id: 42, login: 'hubot'}, event.detail);
assert.strictEqual(document.body, event.target);
Expand Down