Skip to content

Commit

Permalink
Use the created element when setting userData value
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasnetau committed Jul 28, 2023
1 parent fedb19b commit 6f647c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/js/control/hidden.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export default class controlHidden extends control {
* @return {Object} DOM Element to be injected into the form.
*/
build() {
this.field = this.markup('input', null, this.config)
return {
field: this.markup('input', null, this.config),
field: this.field,
layout: 'hidden',
}
}
Expand All @@ -22,7 +23,7 @@ export default class controlHidden extends control {
onRender() {
// Set userData if available
if (this.config.userData) {
$('#' + this.config.name).val(this.config.userData[0])
$(this.field).val(this.config.userData[0])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/control/textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class controlTextarea extends control {
onRender() {
// Set userData if available
if (this.config.userData) {
$('#' + this.config.name).val(this.config.userData[0])
$(this.field).val(this.config.userData[0])
}
}

Expand Down

0 comments on commit 6f647c1

Please sign in to comment.