Fix autofocus after clicking on checkbox
This commit is contained in:
parent
d02fe722de
commit
bb6cda7de5
|
@ -1073,6 +1073,8 @@ export class AppImManager extends EventListenerBase<{
|
||||||
|
|
||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
|
|
||||||
|
const isTargetAnInput = (target.tagName === 'INPUT' && !['checkbox', 'radio'].includes((target as HTMLInputElement).type)) || target.isContentEditable;
|
||||||
|
|
||||||
// if(target.tagName === 'INPUT') return;
|
// if(target.tagName === 'INPUT') return;
|
||||||
|
|
||||||
// this.log('onkeydown', e, document.activeElement);
|
// this.log('onkeydown', e, document.activeElement);
|
||||||
|
@ -1081,7 +1083,7 @@ export class AppImManager extends EventListenerBase<{
|
||||||
|
|
||||||
if((key.startsWith('Arrow') || (e.shiftKey && key === 'Shift')) && !isSelectionCollapsed) {
|
if((key.startsWith('Arrow') || (e.shiftKey && key === 'Shift')) && !isSelectionCollapsed) {
|
||||||
return;
|
return;
|
||||||
} else if(e.code === 'KeyC' && (e.ctrlKey || e.metaKey) && target.tagName !== 'INPUT') {
|
} else if(e.code === 'KeyC' && (e.ctrlKey || e.metaKey) && !isTargetAnInput) {
|
||||||
return;
|
return;
|
||||||
} else if(e.altKey && (key === 'ArrowUp' || key === 'ArrowDown')) {
|
} else if(e.altKey && (key === 'ArrowUp' || key === 'ArrowDown')) {
|
||||||
cancelEvent(e);
|
cancelEvent(e);
|
||||||
|
@ -1108,8 +1110,7 @@ export class AppImManager extends EventListenerBase<{
|
||||||
if(
|
if(
|
||||||
chat?.input?.messageInput &&
|
chat?.input?.messageInput &&
|
||||||
target !== chat.input.messageInput &&
|
target !== chat.input.messageInput &&
|
||||||
target.tagName !== 'INPUT' &&
|
!isTargetAnInput &&
|
||||||
!target.isContentEditable &&
|
|
||||||
!IS_TOUCH_SUPPORTED &&
|
!IS_TOUCH_SUPPORTED &&
|
||||||
(!mediaSizes.isMobile || this.tabId === APP_TABS.CHAT) &&
|
(!mediaSizes.isMobile || this.tabId === APP_TABS.CHAT) &&
|
||||||
!chat.selection.isSelecting &&
|
!chat.selection.isSelecting &&
|
||||||
|
|
Loading…
Reference in New Issue