Skip to content

Commit

Permalink
Merge pull request #1472 from lucasnetau/patches
Browse files Browse the repository at this point in the history
Fix bugs related to textarea.quill
  • Loading branch information
kevinchappell authored Oct 31, 2023
2 parents 5c91f10 + 533ae80 commit 95a8c52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/js/control/textarea.quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export default class controlQuill extends controlTextarea {
//Textareas do not have an attribute 'type'
delete attrs['type']
this.field = this.markup('div', null, attrs)
if (this.field.classList.contains('form-control')) {
this.field.classList.remove('form-control')
}
return this.field
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,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
2 changes: 1 addition & 1 deletion src/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ export const bootstrapColumnRegex = /^col-(xs|sm|md|lg)-([^\s]+)/
* @returns {string[]}
*/
export const getAllGridRelatedClasses = className => {
return className.split(' ').filter(x => bootstrapColumnRegex.test(x) || x.startsWith('row-'))
return (typeof className === 'string') ? className.split(' ').filter(x => bootstrapColumnRegex.test(x) || x.startsWith('row-')) : []
}

/**
Expand Down

0 comments on commit 95a8c52

Please sign in to comment.