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

Commit

Permalink
fix(events): Fix issues causing built-in events to not get fired due …
Browse files Browse the repository at this point in the history
…to case-sensitivity.
  • Loading branch information
treshugart committed Jun 21, 2016
1 parent 642f1b5 commit 198c5cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const defaults = {
};

function syncEvent(node, eventName, newEventHandler) {
const eventNameLc = eventName.toLowerCase();
const eventStore = node.__events || (node.__events = {});
const oldEventHandler = eventStore[eventName];

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

// Bind new listener.
if (newEventHandler) {
node.addEventListener(eventName, eventStore[eventName] = function handler(e) {
node.addEventListener(eventNameLc, eventStore[eventName] = function handler(e) {
newEventHandler.call(this, e);
});
}
Expand Down

0 comments on commit 198c5cd

Please sign in to comment.