diff options
| author | Beebles <102569435+beebls@users.noreply.github.com> | 2025-09-26 16:02:21 -0600 |
|---|---|---|
| committer | Beebles <102569435+beebls@users.noreply.github.com> | 2025-09-26 16:02:21 -0600 |
| commit | e2f36091e2619e18cbe8781053b9d3cd94904a51 (patch) | |
| tree | e6990a0502a317278e24d3f52578cca13381a678 | |
| parent | 6eab1c1e1645eb77129e6124d28acabfcf213f30 (diff) | |
| download | decky-loader-e2f36091e2619e18cbe8781053b9d3cd94904a51.tar.gz decky-loader-e2f36091e2619e18cbe8781053b9d3cd94904a51.zip | |
change to scrollpanelgroup
| -rw-r--r-- | frontend/src/components/AnnouncementsDisplay.tsx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/frontend/src/components/AnnouncementsDisplay.tsx b/frontend/src/components/AnnouncementsDisplay.tsx index fa057045..c62a5d77 100644 --- a/frontend/src/components/AnnouncementsDisplay.tsx +++ b/frontend/src/components/AnnouncementsDisplay.tsx @@ -1,4 +1,4 @@ -import { DialogButton, Focusable, ModalRoot, PanelSection, showModal } from '@decky/ui'; +import { DialogButton, Focusable, ModalRoot, PanelSection, ScrollPanelGroup, showModal } from '@decky/ui'; import { lazy, useEffect, useMemo, useState } from 'react'; import { FaInfo, FaTimes } from 'react-icons/fa'; @@ -200,7 +200,19 @@ function AnnouncementModal({ } `} </style> - <Focusable style={{display: "flex", flexDirection: "column", gap: "0.5rem", overflowY: "scroll", height: "80vh"}}> + <ScrollPanelGroup + // @ts-ignore + focusable={true} + style={{ height: '80vh' }} + // onCancelButton doesn't work here + onCancelActionDescription="Back" + onButtonDown={(evt: any) => { + if (!evt?.detail?.button) return; + if (evt.detail.button === 2) { + closeModal?.(); + } + }} + > <h1>{announcement.title}</h1> <WithSuspense> <MarkdownRenderer @@ -216,7 +228,7 @@ function AnnouncementModal({ <DialogButton onClick={() => onHide()}>Close Popup</DialogButton> <DialogButton onClick={() => onHide()}>Close and Hide Announcement</DialogButton> </Focusable> - </Focusable> + </ScrollPanelGroup> </ModalRoot> ); } |
