fastdom: prevent some errors

This commit is contained in:
jean-emmanuel 2022-01-26 14:14:23 +01:00
parent f4a28dbec7
commit fd5421b929
2 changed files with 2 additions and 2 deletions

View file

@ -67,7 +67,7 @@ class ColorPicker extends UiWidget {
close() {
if (this.parentNode.contains(this.container)) {
if (this.parentNode && this.parentNode.contains(this.container)) {
this.parentNode.removeChild(this.container)
}
this.setName()

View file

@ -114,7 +114,7 @@ class UiDragResize extends UiWidget {
keyboardJS.bind('alt', (e)=>{
if (e.target.tagName !== 'TEXTAREA') this.handles[0].classList.add('full')
}, (e)=>{
if (e.target.tagName !== 'TEXTAREA') this.handles[0].classList.remove('full')
if (e.target && e.target.tagName !== 'TEXTAREA') this.handles[0].classList.remove('full')
})
keyboardJS.bind('alt+c', (e)=>{
if (e.target.tagName === 'TEXTAREA') return