Skip to content

Commit

Permalink
fixed the undefined blockName var
Browse files Browse the repository at this point in the history
  • Loading branch information
ddragosd committed Jan 18, 2024
1 parent 2bc8dc5 commit 21eaf26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const sourceselector = (element) => {
formElementSelector = element.tagName === 'INPUT' ? `form input[type='${element.getAttribute('type')}']` : `form ${element.tagName.toLowerCase()}`;
}

const blockName = element.closest('.block') ? element.closest('.block').getAttribute('data-block-name') : '';
if (element.id || formElementSelector) {
const blockName = element.closest('.block') ? element.closest('.block').getAttribute('data-block-name') : '';
const id = element.id ? `#${element.id}` : '';
return blockName ? `.${blockName} ${formElementSelector}${id}` : `${formElementSelector}${id}`;
}
Expand Down

0 comments on commit 21eaf26

Please sign in to comment.