Reputation: 2688
I want to get a <select>
value and assign it to an amp-state.
In theory I should be able to do event.valueAsNumber as documented here.
However I get "null" back when attempting to use this property.
Upvotes: 1
Views: 381
Reputation: 4288
This looks like a bug as event.valueAsNumber
should work. A workaround is to manually convert the value to an integer using the unary +
operator:
<select on="change:AMP.setState({product: {quantity: +event.value}})">
I've filed a bug here.
Upvotes: 3