Skip to content

Commit

Permalink
fix: case table column header response to undo edit properties change [
Browse files Browse the repository at this point in the history
  • Loading branch information
kswenson authored Jul 21, 2024
1 parent e05b1cb commit f7a1c40
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions v3/src/components/case-table/column-header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Tooltip, Menu, MenuButton, Input, VisuallyHidden } from "@chakra-ui/react"
import { useDndContext } from "@dnd-kit/core"
import { observer } from "mobx-react-lite"
import React, { useCallback, useEffect, useRef, useState } from "react"
import { useDataSetContext } from "../../hooks/use-data-set-context"
import { IUseDraggableAttribute, useDraggableAttribute } from "../../hooks/use-drag-drop"
Expand All @@ -13,7 +14,12 @@ import { ColumnHeaderDivider } from "./column-header-divider"
import { useRdgCellFocus } from "./use-rdg-cell-focus"
import { useCollectionTableModel } from "./use-collection-table-model"

export function ColumnHeader({ column }: TRenderHeaderCellProps) {
// wrapper component because RDG doesn't like observer components as header cell renderers
export function ColumnHeader(props: TRenderHeaderCellProps) {
return <_ColumnHeader {...props}/>
}

const _ColumnHeader = observer(function _ColumnHeader({ column }: TRenderHeaderCellProps) {
const { active } = useDndContext()
const data = useDataSetContext()
const collectionTableModel = useCollectionTableModel()
Expand Down Expand Up @@ -209,4 +215,4 @@ export function ColumnHeader({ column }: TRenderHeaderCellProps) {
}}
</Menu>
)
}
})

0 comments on commit f7a1c40

Please sign in to comment.