Skip to content

Commit 0fc5428

Browse files
Fixed image edit and delete buttons being hidden on touch devices
- the edit/delete buttons relied on hover to become visible, leaving them inaccessible on touch devices where hover doesn't exist - added a `[@media(hover:none)]:visible!` variant so the buttons are always shown when the device has no hover capability
1 parent 46c23fb commit 0fc5428

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/admin-x-design-system/src/global/form/image-upload.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ const ImageUpload: React.FC<ImageUploadProps> = ({
101101

102102
if (!deleteButtonUnstyled) {
103103
deleteButtonClassName = clsx(
104-
'absolute top-4 right-4 flex size-8 cursor-pointer items-center justify-center rounded bg-[rgba(0,0,0,0.75)] text-white group-hover:visible! hover:bg-black md:invisible',
104+
'absolute top-4 right-4 flex size-8 cursor-pointer items-center justify-center rounded bg-[rgba(0,0,0,0.75)] text-white group-hover:visible! hover:bg-black md:invisible [@media(hover:none)]:visible!',
105105
deleteButtonClassName
106106
);
107107
}
108108

109109
if (!editButtonUnstyled) {
110110
editButtonClassName = clsx(
111-
'absolute top-4 right-16 flex size-8 cursor-pointer items-center justify-center rounded bg-[rgba(0,0,0,0.75)] text-white group-hover:visible! hover:bg-black md:invisible',
111+
'absolute top-4 right-16 flex size-8 cursor-pointer items-center justify-center rounded bg-[rgba(0,0,0,0.75)] text-white group-hover:visible! hover:bg-black md:invisible [@media(hover:none)]:visible!',
112112
editButtonClassName
113113
);
114114
}

0 commit comments

Comments
 (0)