We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c613a6 commit 526a148Copy full SHA for 526a148
src/app/[owner]/[repo]/page.tsx
@@ -261,6 +261,24 @@ export default function RepoWikiPage() {
261
}
262
}, [currentPageId]);
263
264
+ // close the modal when escape is pressed
265
+ useEffect(() => {
266
+ const handleEsc = (event: KeyboardEvent) => {
267
+ if (event.key === 'Escape') {
268
+ setIsAskModalOpen(false);
269
+ }
270
+ };
271
+
272
+ if (isAskModalOpen) {
273
+ window.addEventListener('keydown', handleEsc);
274
275
276
+ // Cleanup on unmount or when modal closes
277
+ return () => {
278
+ window.removeEventListener('keydown', handleEsc);
279
280
+ }, [isAskModalOpen]);
281
282
// Fetch authentication status on component mount
283
useEffect(() => {
284
const fetchAuthStatus = async () => {
0 commit comments