mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 19:26:04 +03:00
Add onPaste fallback when getInputableElement returns null (#7540)
This commit is contained in:
parent
6444aaeeff
commit
de28d82b81
1 changed files with 2 additions and 2 deletions
|
@ -385,9 +385,9 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
private onPaste = (ev: ClipboardEvent) => {
|
private onPaste = (ev: ClipboardEvent) => {
|
||||||
const element = ev.target as HTMLElement;
|
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();
|
inputableElement.focus();
|
||||||
} else {
|
} else {
|
||||||
// refocusing during a paste event will make the
|
// refocusing during a paste event will make the
|
||||||
|
|
Loading…
Reference in a new issue