mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
[backport cloud/1.38] fix: Safari compatibility issues in Secrets panel dialog (#8611)
Backport of #8610 to `cloud/1.38` Automatically created by backport workflow. Co-authored-by: Luke Mino-Altherr <luke@comfy.org> Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -20,9 +20,18 @@ defineOptions({
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
position = 'popper',
|
position = 'popper',
|
||||||
|
// Safari has issues with click events on portaled content inside dialogs.
|
||||||
|
// Set disablePortal to true when using Select inside a Dialog on Safari.
|
||||||
|
// See: https://github.com/chakra-ui/ark/issues/1782
|
||||||
|
disablePortal = false,
|
||||||
class: className,
|
class: className,
|
||||||
...restProps
|
...restProps
|
||||||
} = defineProps<SelectContentProps & { class?: HTMLAttributes['class'] }>()
|
} = defineProps<
|
||||||
|
SelectContentProps & {
|
||||||
|
class?: HTMLAttributes['class']
|
||||||
|
disablePortal?: boolean
|
||||||
|
}
|
||||||
|
>()
|
||||||
const emits = defineEmits<SelectContentEmits>()
|
const emits = defineEmits<SelectContentEmits>()
|
||||||
|
|
||||||
const delegatedProps = computed(() => ({
|
const delegatedProps = computed(() => ({
|
||||||
@@ -34,7 +43,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SelectPortal>
|
<SelectPortal :disabled="disablePortal">
|
||||||
<SelectContent
|
<SelectContent
|
||||||
v-bind="{ ...forwarded, ...$attrs }"
|
v-bind="{ ...forwarded, ...$attrs }"
|
||||||
:class="
|
:class="
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
{{ $t('secrets.provider') }}
|
{{ $t('secrets.provider') }}
|
||||||
</label>
|
</label>
|
||||||
<Select v-model="form.provider" :disabled="mode === 'edit'">
|
<Select v-model="form.provider" :disabled="mode === 'edit'">
|
||||||
<SelectTrigger id="secret-provider" class="w-full">
|
<SelectTrigger id="secret-provider" class="w-full" autofocus>
|
||||||
<SelectValue :placeholder="$t('g.none')" />
|
<SelectValue :placeholder="$t('g.none')" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent disable-portal>
|
||||||
<SelectItem
|
<SelectItem
|
||||||
v-for="option in providerOptions"
|
v-for="option in providerOptions"
|
||||||
:key="option.value || 'none'"
|
:key="option.value || 'none'"
|
||||||
@@ -79,10 +79,15 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="flex justify-end gap-2 pt-2">
|
<div class="flex justify-end gap-2 pt-2">
|
||||||
<Button variant="secondary" type="button" @click="visible = false">
|
<Button
|
||||||
|
variant="secondary"
|
||||||
|
type="button"
|
||||||
|
tabindex="0"
|
||||||
|
@click="visible = false"
|
||||||
|
>
|
||||||
{{ $t('g.cancel') }}
|
{{ $t('g.cancel') }}
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit" :loading="loading">
|
<Button type="submit" tabindex="0" :loading="loading">
|
||||||
{{ $t('g.save') }}
|
{{ $t('g.save') }}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user