Skip to content

Commit

Permalink
Add ability to disable drawing focus ring when editor is open
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Mar 13, 2024
1 parent cd45444 commit 5e1f2b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/data-editor/data-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ type Props = Partial<
| "clientSize"
| "columns"
| "disabledRows"
| "drawFocusRing"
| "enableGroups"
| "firstColAccessible"
| "firstColSticky"
Expand Down Expand Up @@ -673,6 +674,8 @@ export interface DataEditorProps extends Props, Pick<DataGridSearchProps, "image
* If set to true, the data grid will attempt to scroll to keep the selction in view
*/
readonly scrollToActiveCell?: boolean;

readonly drawFocusRing?: boolean | "no-overlay";
}

type ScrollToFn = (
Expand Down Expand Up @@ -835,7 +838,6 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
onColumnResizeStart: onColumnResizeStartIn,
customRenderers: additionalRenderers,
fillHandle,
drawFocusRing = true,
experimental,
fixedShadowX,
fixedShadowY,
Expand All @@ -862,8 +864,11 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
renderers,
resizeIndicator,
scrollToActiveCell = true,
drawFocusRing: drawFocusRingIn = true,
} = p;

const drawFocusRing = drawFocusRingIn === "no-overlay" ? overlay === undefined : drawFocusRingIn;

const rowMarkersObj = typeof p.rowMarkers === "string" ? undefined : p.rowMarkers;

const rowMarkers = rowMarkersObj?.kind ?? (p.rowMarkers as RowMarkerOptions["kind"]) ?? "none";
Expand Down

0 comments on commit 5e1f2b6

Please sign in to comment.