Ensure mobile controls dialog closes reliably

This commit is contained in:
beatz174-bit committed 2025-11-24 10:01:35 +10:00
1 parent 7665d004ce
commit 073e3131b2
2 files changed
+31 -5

No files matched your search

+6 -5
View File
@@ -60,6 +60,10 @@ export const PickItemRow = ({
}
};
const handleCloseControls = () => {
setIsControlsOpen(false);
};
const handleRowKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
if (!isNarrowScreen) return;
@@ -182,7 +186,7 @@ export const PickItemRow = ({
{isNarrowScreen && (
<Dialog
open={isControlsOpen}
onClose={() => setIsControlsOpen(false)}
onClose={handleCloseControls}
fullWidth
maxWidth="xs"
aria-labelledby="item-controls-title"
@@ -196,10 +200,7 @@ export const PickItemRow = ({
</Typography>
<IconButton
aria-label="Close controls"
onClick={(event) => {
stopPropagation(event);
setIsControlsOpen(false);
}}
onClick={handleCloseControls}
>
<Close />
</IconButton>