Page MenuHomePhabricator

D7837.id26645.diff
No OneTemporary

D7837.id26645.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
@@ -7,10 +7,11 @@
type ModalOverlayProps = {
+onClose: () => void,
+children?: React.Node,
+ +disableTab?: boolean,
};
function ModalOverlay(props: ModalOverlayProps): React.Node {
- const { children, onClose } = props;
+ const { children, onClose, disableTab } = props;
const overlayRef = React.useRef();
const firstClickRef = React.useRef(null);
@@ -42,8 +43,11 @@
if (event.key === 'Escape') {
onClose();
}
+ if (disableTab && event.key === 'Tab') {
+ event.preventDefault();
+ }
},
- [onClose],
+ [disableTab, onClose],
);
return (
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
@@ -146,7 +146,11 @@
if (!modal) {
return null;
}
- return <ModalOverlay onClose={clearEditModal}>{modal}</ModalOverlay>;
+ return (
+ <ModalOverlay onClose={clearEditModal} disableTab={true}>
+ {modal}
+ </ModalOverlay>
+ );
}, [clearEditModal, modal]);
return (

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 7:39 AM (20 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574591
Default Alt Text
D7837.id26645.diff (1 KB)

Event Timeline