Page MenuHomePhabricator

D7837.id26543.diff
No OneTemporary

D7837.id26543.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
@@ -145,7 +145,9 @@
let modalOverlay;
if (modal) {
modalOverlay = (
- <ModalOverlay onClose={clearEditModal}>{modal}</ModalOverlay>
+ <ModalOverlay onClose={clearEditModal} disableTab={true}>
+ {modal}
+ </ModalOverlay>
);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 6:54 AM (20 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574361
Default Alt Text
D7837.id26543.diff (1 KB)

Event Timeline