Skip to content

Commit

Permalink
fix: prevent togging the edit field if double-clicking within a texta…
Browse files Browse the repository at this point in the history
…rea. Additionally, use the property isContentEditable to check if the element double-clicked is a descendant of a contenteditable field (eg a paragraph withing a div[contenteditable])
  • Loading branch information
lucasnetau committed Oct 26, 2023
1 parent cf04f32 commit a44ef6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@ function FormBuilder(opts, element, $) {
})

$stage.on('dblclick', 'li.form-field', e => {
if (['select', 'input', 'label'].includes(e.target.tagName.toLowerCase()) || e.target.contentEditable === 'true') {
if (['select', 'input', 'label','textarea',].includes(e.target.tagName.toLowerCase()) || e.target.isContentEditable === true) {
return
}
e.stopPropagation()
Expand Down

0 comments on commit a44ef6e

Please sign in to comment.