Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

fix onchange trigger twice for select box #165

Merged
merged 1 commit into from
Sep 7, 2016
Merged
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
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ function applyEventNormalization({ nodeName, attributes }) {
props[i.toLowerCase()] = i;
}
if (props.onchange) {
let attr = 'oninput';
nodeName = nodeName.toLowerCase();
let attr = nodeName==='select' ? 'onchange' : 'oninput';
if (nodeName==='input' && String(attributes.type).toLowerCase()==='checkbox') attr = 'onclick';
attributes[props[attr] || attr] = multihook(attributes[props[attr]], attributes[props.onchange]);
}
Expand Down