Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/@react-spectrum/ai/src/AttachmentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ import {getMimeTypeLabel, matchMimeType} from './PromptField';
import {Image, ImageContext, ImageProps} from '@react-spectrum/s2/Image';
import {ImageCoordinator} from '@react-spectrum/s2/ImageCoordinator';
import ImageIcon from '@react-spectrum/s2/icons/Image';
// @ts-ignore
import intlMessages from '../intl/*.json';
import {keyframes, scrollFade} from './style/style-macro' with {type: 'macro'};
import {LightboxTriggerContext} from './Lightbox';
import {mergeStyles} from '@react-spectrum/s2/mergeStyles';
import Play from '@react-spectrum/s2/icons/Play';
import {pressScale} from '@react-spectrum/s2/pressScale';
Expand Down Expand Up @@ -344,7 +346,7 @@ export interface AttachmentListProps<T>
| 'escapeKeyBehavior'
| 'onSelectionChange'
| 'shouldSelectOnPressUp'
| 'onAction'
// | 'onAction'
| 'render'
| 'style'
| 'className'
Expand Down Expand Up @@ -496,6 +498,8 @@ export const AttachmentList = (forwardRef as forwardRefType)(function Attachment
let domRef = useDOMRef(ref);
let scrollRef = useRef<HTMLDivElement>(null);
let {direction} = useLocale();
let ctx = useContext(LightboxTriggerContext);

let scroll = (dir: 1 | -1) => {
let el = scrollRef.current;
if (!el) {
Expand All @@ -519,6 +523,7 @@ export const AttachmentList = (forwardRef as forwardRefType)(function Attachment
return (
<TagGroup
{...otherProps}
onAction={ctx?.onAction}
className={mergeStyles(style({...flexRow, gap: 8, position: 'relative'}), styles)}
style={
{
Expand Down
Loading
Loading