Skip to content

Commit

Permalink
fix: Remove unreachable branch in condition. $().closest can be used …
Browse files Browse the repository at this point in the history
…for both cases as closest() starts traversal from the current element
  • Loading branch information
lucasnetau committed Sep 19, 2023
1 parent 614a92f commit 619005a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1689,8 +1689,7 @@ function FormBuilder(opts, element, $) {
e.stopPropagation()
e.preventDefault()
if (e.handled !== true) {
const targetID =
e.target.tagName == 'li' ? $(e.target).attr('id') : $(e.target).closest('li.form-field').attr('id')
const targetID = $(e.target).closest('li.form-field').attr('id')
h.toggleEdit(targetID)
e.handled = true
}
Expand Down

0 comments on commit 619005a

Please sign in to comment.