@@ -45,6 +45,8 @@ const ExpandedRowContent = memo(({ row }: { row: { original: UserResponse } }) =
4545export const DataTable = memo ( < TData extends UserResponse , TValue > ( { columns, data, isLoading = false , onEdit } : DataTableProps < TData , TValue > ) => {
4646 const { t } = useTranslation ( )
4747 const [ expandedRow , setExpandedRow ] = useState < number | null > ( null )
48+ /** CSS :hover can stick after closing portaled menus; drive md+ row bg with pointer events instead. */
49+ const [ hoveredRowId , setHoveredRowId ] = useState < number | null > ( null )
4850 const dir = useDirDetection ( )
4951 const isRTL = dir === 'rtl'
5052
@@ -138,7 +140,13 @@ export const DataTable = memo(<TData extends UserResponse, TValue>({ columns, da
138140 ? table . getRowModel ( ) . rows . map ( row => (
139141 < React . Fragment key = { row . id } >
140142 < TableRow
141- className = { cn ( 'cursor-pointer border-b hover:!bg-inherit md:cursor-default md:hover:!bg-muted/50' , expandedRow === row . original . id && 'border-transparent' ) }
143+ className = { cn (
144+ 'cursor-pointer border-b md:cursor-default max-md:hover:!bg-inherit' ,
145+ hoveredRowId === row . original . id ? 'md:!bg-muted/50' : 'md:hover:!bg-inherit' ,
146+ expandedRow === row . original . id && 'border-transparent' ,
147+ ) }
148+ onMouseEnter = { ( ) => setHoveredRowId ( row . original . id ) }
149+ onMouseLeave = { ( ) => setHoveredRowId ( null ) }
142150 onClick = { e => handleEditModal ( e , row . original ) }
143151 data-state = { row . getIsSelected ( ) && 'selected' }
144152 >
0 commit comments