Skip to content

Commit

Permalink
Merge pull request #3 from yoannisj/feature/nested-input-names
Browse files Browse the repository at this point in the history
add support for neste input names - Fixes #2
  • Loading branch information
simomosi committed Apr 10, 2022
2 parents fa5e4fa + feccf17 commit 2477a31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DynamicElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DynamicElement {

let event = this.io.event ?? DynamicElement.defaultConfig.io.event;

this.htmlElement = dynamicForm.htmlElement.querySelectorAll(`[name=${config.name}]`);
this.htmlElement = dynamicForm.htmlElement.querySelectorAll(`[name="${config.name}"]`);
this.name = this.htmlElement[0].name;
if (this.htmlElement.length === 0) {
throw new Error(`Element ${config.name} not found`);
Expand Down
2 changes: 1 addition & 1 deletion src/DynamicForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DynamicForm {

// Create fields instance
formConfiguration.fields.forEach(fieldConfig => {
let queryResult = self.htmlElement.querySelectorAll(`[name=${fieldConfig.name}]`);
let queryResult = self.htmlElement.querySelectorAll(`[name="${fieldConfig.name}"]`);
let type = null, instance = null;

if (queryResult.length === 0) {
Expand Down

0 comments on commit 2477a31

Please sign in to comment.