Add onPaste fallback when getInputableElement returns null (#7540)

pull/21833/head
Germain 2022-01-14 12:49:09 +00:00 committed by GitHub
parent 6444aaeeff
commit de28d82b81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -385,9 +385,9 @@ class LoggedInView extends React.Component<IProps, IState> {
private onPaste = (ev: ClipboardEvent) => {
const element = ev.target as HTMLElement;
const inputableElement = getInputableElement(element);
const inputableElement = getInputableElement(element) || document.activeElement as HTMLElement;
if (inputableElement) {
if (inputableElement?.focus) {
inputableElement.focus();
} else {
// refocusing during a paste event will make the