fix(web): prevent Safari clipping tour recovery prompt (#41060)

This commit is contained in:
yyh authored and GitHub committed 2026-08-21 09:19:38 +00:00
1 parent b38d907ede
commit faca558bf5
14 files changed
+473 -290

No files matched your search

@@ -13,7 +13,9 @@ import { IconButton } from '@langgenius/dify-ui/icon-button'
import {
Popover,
PopoverClose,
PopoverContent,
PopoverPopup,
PopoverPortal,
PopoverPositioner,
PopoverTitle,
PopoverTrigger,
} from '@langgenius/dify-ui/popover'
@@ -154,49 +156,52 @@ function BlockSelector({
return (
<Popover modal="trap-focus" open={open} onOpenChange={handleOpenChange}>
{triggerWithTooltip}
<PopoverContent
placement={placement}
sideOffset={sideOffset}
alignOffset={alignOffset}
positionerProps={{ positionMethod: 'fixed' }}
popupClassName="border-none bg-transparent shadow-none"
popupProps={{
initialFocus: searchInputRef,
onClick: handlePopupClick,
...(isolateKeyboardEvents ? { onKeyDown: handlePopupKeyDown } : {}),
}}
>
<PopoverTitle className="sr-only">
{t(($) => $['common.addBlock'], { ns: 'workflow' })}
</PopoverTitle>
<div
className={cn(
'w-100 min-w-0 overflow-hidden rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg',
popupClassName,
)}
<PopoverPortal>
<PopoverPositioner
placement={placement}
sideOffset={sideOffset}
alignOffset={alignOffset}
positionMethod="fixed"
>
<BlockSelectorContent
standalonePanel={standalonePanel}
searchInputRef={searchInputRef}
blocks={blocks}
onSelect={handleSelect}
onRequestClose={() => handleOpenChange(false)}
availableBlocksTypes={availableBlocksTypes}
dataSources={dataSources}
noBlocks={noBlocks}
noTools={noTools}
showStartTab={showStartTab}
defaultActiveTab={defaultActiveTab}
ignoreNodeIds={ignoreNodeIds}
forceEnableStartTab={forceEnableStartTab}
allowUserInputSelection={allowUserInputSelection}
snippetInsertPayload={snippetInsertPayload}
/>
</div>
<PopoverClose className="sr-only" tabIndex={-1}>
{t(($) => $['operation.close'], { ns: 'common' })}
</PopoverClose>
</PopoverContent>
<PopoverPopup
initialFocus={searchInputRef}
className="border-none bg-transparent shadow-none"
onClick={handlePopupClick}
onKeyDown={isolateKeyboardEvents ? handlePopupKeyDown : undefined}
>
<PopoverTitle className="sr-only">
{t(($) => $['common.addBlock'], { ns: 'workflow' })}
</PopoverTitle>
<div
className={cn(
'w-100 min-w-0 overflow-hidden rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg',
popupClassName,
)}
>
<BlockSelectorContent
standalonePanel={standalonePanel}
searchInputRef={searchInputRef}
blocks={blocks}
onSelect={handleSelect}
onRequestClose={() => handleOpenChange(false)}
availableBlocksTypes={availableBlocksTypes}
dataSources={dataSources}
noBlocks={noBlocks}
noTools={noTools}
showStartTab={showStartTab}
defaultActiveTab={defaultActiveTab}
ignoreNodeIds={ignoreNodeIds}
forceEnableStartTab={forceEnableStartTab}
allowUserInputSelection={allowUserInputSelection}
snippetInsertPayload={snippetInsertPayload}
/>
</div>
<PopoverClose className="sr-only" tabIndex={-1}>
{t(($) => $['operation.close'], { ns: 'common' })}
</PopoverClose>
</PopoverPopup>
</PopoverPositioner>
</PopoverPortal>
</Popover>
)
}
@@ -1,7 +1,12 @@
import type { Recipient as RecipientItem } from '../../../types'
import type { Member } from '@/models/common'
import { cn } from '@langgenius/dify-ui/cn'
import { Popover, PopoverContent } from '@langgenius/dify-ui/popover'
import {
Popover,
PopoverPopup,
PopoverPortal,
PopoverPositioner,
} from '@langgenius/dify-ui/popover'
import * as React from 'react'
import { useCallback, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
@@ -144,24 +149,30 @@ const EmailInput = ({ email, value, list, onDelete, onSelect, onAdd, disabled =
onChange={handleValueChange}
onKeyDown={handleKeyDown}
/>
<PopoverContent
placement="bottom-start"
sideOffset={4}
alignOffset={-40}
popupClassName="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
popupProps={{ initialFocus: false, finalFocus: false }}
positionerProps={{ anchor: inputRef }}
>
<MemberList
searchValue={searchKey}
list={list}
value={value}
onSearchChange={setSearchKey}
onSelect={handleSelect}
email={email}
hideSearch
/>
</PopoverContent>
<PopoverPortal>
<PopoverPositioner
placement="bottom-start"
sideOffset={4}
alignOffset={-40}
anchor={inputRef}
>
<PopoverPopup
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
initialFocus={false}
finalFocus={false}
>
<MemberList
searchValue={searchKey}
list={list}
value={value}
onSearchChange={setSearchKey}
onSelect={handleSelect}
email={email}
hideSearch
/>
</PopoverPopup>
</PopoverPositioner>
</PopoverPortal>
</Popover>
)}
</div>