mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix(ui): suppress iOS long-press callout on ref image thumbnails
The default iOS "Save Image" / "Copy" callout fires on long-press over the thumbnail, which interferes with drag attempts on iPad. Scope the suppression (WebkitTouchCallout + userSelect) to the ref image wrapper only, leaving gallery and other image views unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,13 @@ const weightDisplaySx: SystemStyleObject = {
|
||||
},
|
||||
};
|
||||
|
||||
// Scoped to ref image thumbnails only: prevents the iOS long-press "Save Image"
|
||||
// callout from hijacking drag attempts on iPad.
|
||||
const wrapperSx: SystemStyleObject = {
|
||||
WebkitTouchCallout: 'none',
|
||||
userSelect: 'none',
|
||||
};
|
||||
|
||||
const getImageSxWithWeight = (weight: number): SystemStyleObject => {
|
||||
const fillPercentage = Math.max(0, Math.min(100, weight * 100));
|
||||
|
||||
@@ -120,6 +127,7 @@ export const RefImagePreview = memo(() => {
|
||||
flexShrink={0}
|
||||
opacity={isDragging ? 0.3 : 1}
|
||||
data-ref-image-id={id}
|
||||
sx={wrapperSx}
|
||||
>
|
||||
<IconButton
|
||||
aria-label={t('controlLayers.selectRefImage')}
|
||||
@@ -152,6 +160,7 @@ export const RefImagePreview = memo(() => {
|
||||
flexShrink={0}
|
||||
opacity={isDragging ? 0.3 : 1}
|
||||
data-ref-image-id={id}
|
||||
sx={wrapperSx}
|
||||
>
|
||||
<Tooltip label={warnings.length > 0 ? <RefImageWarningTooltipContent warnings={warnings} /> : undefined}>
|
||||
<Flex
|
||||
|
||||
Reference in New Issue
Block a user