built-in client: add nofocus client option to prevent the client window from taking focus unless a text input or a dropdown is clicked

This commit is contained in:
bordun 2021-06-23 22:32:24 +02:00
parent 13c7f80052
commit 7528f702aa
3 changed files with 12 additions and 0 deletions

View file

@ -33,6 +33,10 @@ function mouseToFastClick(event) {
DOM.dispatchEvent(e.target, name, e)
if (ENV.nofocus && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
console.debug('ELECTRON.BLUR()')
}
}
function touchToFastClick(event) {
@ -59,6 +63,10 @@ function touchToFastClick(event) {
}, 600)
if (ENV.nofocus && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
console.debug('ELECTRON.BLUR()')
}
}
if (!iOS) document.addEventListener('pointerdown', mouseToFastClick, true)