Skip to content

Commit

Permalink
fix: change onChange to onInput for components, fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmessing committed Aug 24, 2017
1 parent b67beeb commit d6ce6a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -360,7 +360,7 @@ var genComponentModel = function genComponentModel(t, modelAttribute, model, mod
var valueProp = t.JSXAttribute(t.jSXIdentifier('domPropsValue'), t.JSXExpressionContainer(model))

var handlerProp = t.JSXAttribute(
t.JSXIdentifier('onChange'),
t.JSXIdentifier('onInput'),
t.JSXExpressionContainer(t.ArrowFunctionExpression([baseValueExpression], t.BlockStatement([assignment])))
)

Expand Down
6 changes: 3 additions & 3 deletions test/snapshots/test.js.md
Expand Up @@ -177,7 +177,7 @@ Generated by [AVA](https://ava.li).
`var _this = this;␊
<custom-element domPropsValue={a.b} onChange={$$v => {␊
<custom-element domPropsValue={a.b} onInput={$$v => {␊
a.b = _this._n($$v);␊
}} {...{␊
directives: [{␊
Expand All @@ -198,7 +198,7 @@ Generated by [AVA](https://ava.li).

> Compiled code
`<custom-element domPropsValue={a.b} onChange={$$v => {␊
`<custom-element domPropsValue={a.b} onInput={$$v => {␊
a.b = $$v.trim();␊
}} {...{␊
directives: [{␊
Expand All @@ -219,7 +219,7 @@ Generated by [AVA](https://ava.li).

> Compiled code
`<custom-element domPropsValue={a.b} onChange={$$v => {␊
`<custom-element domPropsValue={a.b} onInput={$$v => {␊
a.b = $$v;␊
}} {...{␊
directives: [{␊
Expand Down
Binary file modified test/snapshots/test.js.snap
Binary file not shown.

0 comments on commit d6ce6a4

Please sign in to comment.