Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3352674
D7837.id26543.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7837.id26543.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7837: [web] Added FocusTrap for modals
Attached
Detach File
Event Timeline
Log In to Comment