Last active
October 9, 2016 16:35
-
-
Save dsharrison/5e686c8e430a8ead77c91f2f4401ca3a to your computer and use it in GitHub Desktop.
A reduced test case for the issues with <lightning:input /> bindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable"> | |
<!-- public attributes --> | |
<aura:attribute name="myObj" type="Account" default="{Name: '', Type: ''}" access="PUBLIC" /> | |
<!-- body markup --> | |
<c:lightningInputReproFields record="{!v.myObj}" /> | |
<lightning:button label="Update Object" onclick="{!c.updateObj}" /> | |
<lightning:button label="Update Name" onclick="{!c.updateName}" /> | |
</aura:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
updateObj: function (component, event, helper) { | |
var rand = Math.floor(Math.random() * 99); | |
var newObj = { | |
'Name': 'new name ' + rand, | |
'Type': 'new type ' + rand | |
}; | |
component.set('v.myObj', newObj); | |
}, | |
updateName: function (component, event, helper) { | |
var rand = Math.floor(Math.random() * 99); | |
component.set('v.myObj.Name', 'new name ' + rand); | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component > | |
<!-- public attributes --> | |
<aura:attribute name="record" type="Account" default="{Name: '', Type: ''}" access="PUBLIC" /> | |
<!-- body markup --> | |
<lightning:input name="name" type="text" label="Name" value="{!v.record.Name}" /> | |
<lightning:input name="type" type="text" label="Type" value="{!v.record.Type}" /> | |
</aura:component> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment