mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Message: Only focus if focus is not inside container already
This commit is contained in:
@@ -11,8 +11,10 @@ export class InlineNotificationWrapper extends React.Component<PropsType> {
|
||||
public focusRef: React.RefObject<HTMLDivElement> = React.createRef();
|
||||
|
||||
public setFocus = () => {
|
||||
if (this.focusRef.current) {
|
||||
this.focusRef.current.focus();
|
||||
const container = this.focusRef.current;
|
||||
|
||||
if (container && !container.contains(document.activeElement)) {
|
||||
container.focus();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user