Fix #4797 request switcher auto-focus from CodeMirror (#5002)

Fixes the input `.focus()` method call. The simplest fix was to revert the change in 3cf464d059.

There do not seem to be any new problems in the current application from reverting this commit's relevant changes, indicating that the original cause of the bug is no longer present.
This commit is contained in:
Daniel Stone 2022-07-28 12:13:01 +01:00 committed by GitHub
parent 1a464446b0
commit fa7dd44d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 6 deletions

View File

@ -16,7 +16,6 @@ export interface ModalProps {
wide?: boolean;
skinny?: boolean;
noEscape?: boolean;
dontFocus?: boolean;
closeOnKeyCodes?: any[];
onShow?: Function;
onHide?: Function;
@ -118,10 +117,6 @@ export class Modal extends PureComponent<ModalProps, State> {
this.props.onShow?.();
if (this.props.dontFocus) {
return;
}
// Allow instance-based onHide method
this.onHide = options?.onHide ?? null;
setTimeout(() => this._node?.focus());

View File

@ -412,7 +412,6 @@ class RequestSwitcherModal extends PureComponent<ReduxProps, State> {
<KeydownBinder onKeydown={this._handleKeydown} onKeyup={this._handleKeyup}>
<Modal
ref={this._setModalRef}
dontFocus={!disableInput}
className={isModalVisible ? '' : 'hide'}
>
<ModalHeader hideCloseButton>