Skip to content

Commit

Permalink
fix: prevent video playback from propagating double-click events #228
Browse files Browse the repository at this point in the history
  • Loading branch information
blinko-space committed Dec 5, 2024
1 parent ec90d06 commit df6069e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Common/AttachmentRender/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AttachmentsRender = observer((props: IProps) => {
<div className={`columns-1 md:columns-1`}>
{files?.filter(i => i.previewType == 'video').map((file, index) => (
<div className='group relative flex p-2 items-center gap-2 cursor-pointer tansition-all rounded-2xl'>
<video src={file.preview} id="player" playsInline controls className='rounded-2xl w-full z-0' />
<video onDoubleClick={(e) => e.stopPropagation()} src={file.preview} id="player" playsInline controls className='rounded-2xl w-full z-0' />
{!file.uploadPromise?.loading?.value && !preview &&
<DeleteIcon className='absolute z-10 right-[5px] top-[5px]' files={files} file={file} />
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Common/Editor/toolBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ export const Toolbar = ({
eventBus.emit('editor:setViewMode', nextMode);
}}
>
{viewMode === 'source' ?
<Icon icon="tabler:source-code" className='transition-all !text-red-500' /> :
<Icon icon="iconoir:ecology-book" className='transition-all' />
{viewMode !== 'source' ?
<Icon icon="tabler:source-code" className='transition-all' /> :
<Icon icon="grommet-icons:form-view" className='transition-all !text-red-500' />
}
</ButtonWithTooltip>

Expand Down

0 comments on commit df6069e

Please sign in to comment.