-
Notifications
You must be signed in to change notification settings - Fork 408
Caches the contract code and ABI inputs #221
Conversation
@@ -53,11 +53,11 @@ | |||
<select class="compiled-contracts"> | |||
<option disabled selected>{{i18n "wallet.contracts.pickContract"}}</option> | |||
{{#each this}} | |||
<option value="{{name}}">{{toSentence name true}}</option> | |||
<option value="{{name}}" selected="{{selected}}">{{toSentence name true}}</option> |
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.
@alexvandesande The sole existence of selected
attribute will mark the element as selected. So instead of outputting only true/false inside the selected attribute, the return value of your helper must be the attr itself.
Here I advise you to:
<option value="{{name}}" {{selected}}>{{...}}</option>
and then on helper:
contract.selected = (contract.name == e.currentTarget.value)? 'selected' : '';
Otherwise all elements will have the selected attribute, therefore, selecting the last element by default – the last element parsed. See this codepen for practical examples: http://codepen.io/evertonfraga/pen/YWGBON
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.
It turns out blaze behaves differently from regular dom api on this matter. That won't be a problem. See blaze selected attribute issue
Suggested on this PR: Add caching to contract #139
This is particularly useful when you need the address of a contract as one of the parameters for another contract (creating a dao that uses a token for example) and you want to go to another tab to copy it