Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit 198c5cd

Browse files
committed
fix(events): Fix issues causing built-in events to not get fired due to case-sensitivity.
1 parent 642f1b5 commit 198c5cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const defaults = {
77
};
88

99
function syncEvent(node, eventName, newEventHandler) {
10+
const eventNameLc = eventName.toLowerCase();
1011
const eventStore = node.__events || (node.__events = {});
1112
const oldEventHandler = eventStore[eventName];
1213

@@ -17,7 +18,7 @@ function syncEvent(node, eventName, newEventHandler) {
1718

1819
// Bind new listener.
1920
if (newEventHandler) {
20-
node.addEventListener(eventName, eventStore[eventName] = function handler(e) {
21+
node.addEventListener(eventNameLc, eventStore[eventName] = function handler(e) {
2122
newEventHandler.call(this, e);
2223
});
2324
}

0 commit comments

Comments
 (0)