Skip to content

Commit

Permalink
fix: Regression introduced in #176 (#179)
Browse files Browse the repository at this point in the history
* addresses a problem where users couldn't drag clips #176
  • Loading branch information
Segergren authored Feb 14, 2024
1 parent b82f5e7 commit 342dfee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ClientApp/src/components/Bookmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {

export const Bookmark = forwardRef<HTMLDivElement, Props>(
({ id, time = 0, type = BookmarkType.Manual }, ref) => {
let className = 'grid grid-flow-col absolute rounded-lg h-full bg-yellow-400';
let className = 'grid grid-flow-col absolute rounded-lg h-full bg-yellow-400 bookmark';
return (
<div
ref={ref}
Expand Down
16 changes: 2 additions & 14 deletions ClientApp/src/pages/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,8 @@ export const Player: React.FC<Props> = ({ videos }) => {

// Enables clicking on the bookmark icon.
function findBookmarkAncestorOrSelf(element: HTMLDivElement): HTMLDivElement {
if (element.hasAttribute('data-index')) {
return element;
}

let parentElement: HTMLElement | null = element.parentElement;
while (parentElement) {
if (parentElement.hasAttribute('data-index')) {
return parentElement as HTMLDivElement;
}
parentElement = parentElement.parentElement;
}

// If no parent with data-index was found, return the original element
return element;
const bookmarkElement = element.closest('.bookmark');
return bookmarkElement as HTMLDivElement || element;
}

function handleOnMouseUp(e: MouseEvent) {
Expand Down

0 comments on commit 342dfee

Please sign in to comment.