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 mixed case events #788

Open
wants to merge 5 commits into
base: master
from
Jump to file or symbol
Failed to load files and symbols.
+5 −3
Diff settings

Always

Just for now

Copy path View file
@@ -69,8 +69,10 @@ export function setAccessor(node, name, old, value, isSvg) {
if (value) node.innerHTML = value.__html || '';
}
else if (name[0]=='o' && name[1]=='n') {
let useCapture = name !== (name=name.replace(/Capture$/, ''));
name = name.toLowerCase().substring(2);
let useCapture = name !== (name=name.replace(/Capture$/, '')),
lc = name.toLowerCase();
if (lc in node) name = lc;
name = name.substring(2);
if (value) {
if (!old) node.addEventListener(name, eventProxy, useCapture);
}
@@ -113,5 +115,5 @@ function setProperty(node, name, value) {
* @private
*/
function eventProxy(e) {
return this._listeners[e.type](options.event && options.event(e) || e);
return this._listeners[e.type.toLowerCase()](options.event && options.event(e) || e);
}
ProTip! Use n and p to navigate between commits in a pull request.