Fixed bool dropdown in contract execution #3823
Conversation
jacogr
commented
Dec 12, 2016
- Fixes https://github.com/ethcore/parity/issues/3822
- Wrote breaking tests to replicate issue (and also added checks for TypedInput & DetailsStep for the same type)
{ boolitems } | ||
</Select> | ||
); | ||
} | ||
|
||
onChangeBool = (event, _index, value) => { | ||
this.props.onChange(value === 'true'); | ||
// NOTE: event.target.value added for enzyme simulated event testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not happy with this but i'm not sure there's a better solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use the _index
var ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ngotchac Isn't it kind of fragile to depend on the order in the dropdown?
Thinking about e.target.value
: It's actually spec-compatible, so I'm fine with it. Material UI actually adds the value
parameter in a non-spec way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ['false', 'true']
Array should be saved and used when creating the menu items and onChange IMO
Changes Unknown when pulling 3a7e30e on jg-typedinput-tests into ** on master**. |