Page MenuHomePhabricator

D7838.diff
No OneTemporary

D7838.diff

diff --git a/lib/components/modal-overlay.react.js b/lib/components/modal-overlay.react.js
--- a/lib/components/modal-overlay.react.js
+++ b/lib/components/modal-overlay.react.js
@@ -8,19 +8,20 @@
+onClose: () => void,
+children?: React.Node,
+disableTab?: boolean,
+ +disableAutoFocus?: boolean,
};
function ModalOverlay(props: ModalOverlayProps): React.Node {
- const { children, onClose, disableTab } = props;
+ const { children, onClose, disableTab, disableAutoFocus } = props;
const overlayRef = React.useRef();
const firstClickRef = React.useRef(null);
React.useLayoutEffect(() => {
- if (overlayRef.current) {
+ if (!disableAutoFocus && overlayRef.current) {
overlayRef.current.focus();
}
- }, []);
+ }, [disableAutoFocus]);
const onBackgroundMouseDown = React.useCallback(event => {
firstClickRef.current = event.target;
diff --git a/web/chat/edit-message-provider.js b/web/chat/edit-message-provider.js
--- a/web/chat/edit-message-provider.js
+++ b/web/chat/edit-message-provider.js
@@ -147,7 +147,11 @@
return null;
}
return (
- <ModalOverlay onClose={clearEditModal} disableTab={true}>
+ <ModalOverlay
+ onClose={clearEditModal}
+ disableTab={true}
+ disableAutoFocus={true}
+ >
{modal}
</ModalOverlay>
);

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 4:35 AM (20 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573946
Default Alt Text
D7838.diff (1 KB)

Event Timeline