Skip to content

Commit

Permalink
Merge pull request #1384 from lucasnetau/unattachedDomElement
Browse files Browse the repository at this point in the history
Use the created element when setting userData value
  • Loading branch information
kevinchappell authored Aug 14, 2023
2 parents e0feee8 + 6f647c1 commit af86e8a
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 af86e8a

Please sign in to comment.