ui: prevent conflicting alt key binding

This commit is contained in:
jean-emmanuel 2021-12-17 09:56:22 +01:00
parent 80c0f40106
commit 818375c57f

View file

@ -111,14 +111,16 @@ class UiDragResize extends UiWidget {
keyboardJS.withContext('editing', ()=>{
keyboardJS.bind('alt', (e)=>{
this.handles[0].classList.add('full')
if (e.target.tagName !== 'TEXTAREA') this.handles[0].classList.add('full')
}, (e)=>{
this.handles[0].classList.remove('full')
if (e.target.tagName !== 'TEXTAREA') this.handles[0].classList.remove('full')
})
keyboardJS.bind('alt+c', (e)=>{
if (e.target.tagName === 'TEXTAREA') return
this.copying = true
this.container.classList.add('copying')
}, (e)=>{
if (e.target.tagName === 'TEXTAREA') return
this.copying = false
this.container.classList.remove('copying')
})