babel-plugin-jsx-event-modifiers
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -112,3 +112,3 @@ module.exports = babel => { | ||
path.node.attributes.forEach(attribute => { | ||
if (attribute.name.type !== 'JSXNamespacedName' || attribute.name.namespace.name.indexOf('on') !== 0) { | ||
if (t.isJSXSpreadAttribute(attribute) || attribute.name.type !== 'JSXNamespacedName' || attribute.name.namespace.name.indexOf('on') !== 0) { | ||
return attributes.push(attribute) | ||
@@ -115,0 +115,0 @@ } |
{ | ||
"name": "babel-plugin-jsx-event-modifiers", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "JSX Syntactic Sugar Plugin for Event Modifiers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,2 +10,15 @@ import test from 'ava' | ||
test('ignore spread', t => { | ||
t.is( | ||
transpile(`<input {...a} onKeyUp:prevent={this.method} />`), | ||
`var _this = this; | ||
<input {...a} onKeyUp={event => { | ||
event.preventDefault(); | ||
_this.method(event); | ||
}} />;` | ||
) | ||
}) | ||
test(':{ keyCode } modifier', t => { | ||
@@ -12,0 +25,0 @@ t.is( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123030
284