feat(Segments Looping) : Fixed looping through Segments of SEG (#4793)
This commit is contained in:
1 parent
4ecffe89cb
commit
4b63d48518
6 files changed
+87
-55
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { Button } from '../../components/Button/Button';
|
||||
import {
|
||||
DropdownMenu,
|
||||
@@ -97,6 +97,13 @@ const DataRow: React.FC<DataRowProps> = ({
|
||||
}) => {
|
||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||
const isTitleLong = title?.length > 25;
|
||||
const rowRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (isSelected && rowRef.current) {
|
||||
rowRef.current.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}, [isSelected]);
|
||||
|
||||
const handleAction = (action: string, e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
@@ -181,7 +188,9 @@ const DataRow: React.FC<DataRowProps> = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`flex flex-col ${isVisible ? '' : 'opacity-60'}`}>
|
||||
<div
|
||||
ref={rowRef}
|
||||
className={`flex flex-col ${isVisible ? '' : 'opacity-60'}`}>
|
||||
<div
|
||||
className={`flex items-center ${
|
||||
isSelected ? 'bg-popover' : 'bg-muted'
|
||||
|
||||
Reference in new issue
Block a user