-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update eslint deps #3615
Update eslint deps #3615
Changes from 14 commits
1ae3d7f
902d96d
2141ff4
5878ec9
6fcc3fc
3245e76
0680367
ca70f3b
61a661e
d6eb0dd
c5b8f74
706019a
8438db8
a3d1f21
9ca5f15
5ce5789
6c45583
aad8f92
6fd1524
222e2c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -917,18 +917,22 @@ function DataGrid<R, SR, K extends Key>( | |
); | ||
} | ||
|
||
function cancelEditing() { | ||
setSelectedPosition(({ idx, rowIdx }) => ({ idx, rowIdx, mode: 'SELECT' })); | ||
} | ||
|
||
function closeEditor(shouldFocusCell: boolean) { | ||
shouldFocusCellRef.current = shouldFocusCell; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we just use a state instead of dancing around the limitations? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can completely remove the ref and use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a state now |
||
cancelEditing(); | ||
} | ||
|
||
function getCellEditor(rowIdx: number) { | ||
if (selectedPosition.rowIdx !== rowIdx || selectedPosition.mode === 'SELECT') return; | ||
|
||
const { idx, row } = selectedPosition; | ||
const column = columns[idx]; | ||
const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row }); | ||
|
||
const closeEditor = (shouldFocusCell: boolean) => { | ||
shouldFocusCellRef.current = shouldFocusCell; | ||
setSelectedPosition(({ idx, rowIdx }) => ({ idx, rowIdx, mode: 'SELECT' })); | ||
}; | ||
|
||
const onRowChange = (row: R, commitChanges: boolean, shouldFocusCell: boolean) => { | ||
if (commitChanges) { | ||
// Prevents two issues when editor is closed by clicking on a different cell | ||
|
@@ -946,7 +950,7 @@ function DataGrid<R, SR, K extends Key>( | |
|
||
if (rows[selectedPosition.rowIdx] !== selectedPosition.originalRow) { | ||
// Discard changes if rows are updated from outside | ||
closeEditor(false); | ||
cancelEditing(); | ||
} | ||
|
||
return ( | ||
|
@@ -1061,7 +1065,6 @@ function DataGrid<R, SR, K extends Key>( | |
// Reset the positions if the current values are no longer valid. This can happen if a column or row is removed | ||
if (selectedPosition.idx > maxColIdx || selectedPosition.rowIdx > maxRowIdx) { | ||
setSelectedPosition({ idx: -1, rowIdx: minRowIdx - 1, mode: 'SELECT' }); | ||
setDraggedOverRowIdx(undefined); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed? We do set it to undefined after the drag operation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible that the rows update while we're dragging? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably. I added it back for now. I will look into alternatives |
||
} | ||
|
||
let templateRows = `repeat(${headerRowsCount}, ${headerRowHeight}px)`; | ||
|
@@ -1245,7 +1248,7 @@ function DataGrid<R, SR, K extends Key>( | |
<ScrollToCell | ||
scrollToPosition={scrollToPosition} | ||
setScrollToCellPosition={setScrollToPosition} | ||
gridElement={gridRef.current!} | ||
gridRef={gridRef} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
/> | ||
)} | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ export function useViewportColumns<R, SR>({ | |
|
||
const updateStartIdx = (colIdx: number, colSpan: number | undefined) => { | ||
if (colSpan !== undefined && colIdx + colSpan > colOverscanStartIdx) { | ||
// eslint-disable-next-line react-compiler/react-compiler | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should open an issue |
||
startIdx = colIdx; | ||
return true; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the eslint-plugin. Not sure why is it failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the plugin needs to export
Plugin
, manually tweaking the declaration files fixes it.Composite projects require declaration files to be emitted, and TS can't emit a declaration file without access to the
Plugin
type from the@tanstack/eslint-plugin-router
.Should open an issue.