-
-
Notifications
You must be signed in to change notification settings - Fork 1
Paul.diaz/make spreadsheet component able to handle selection column #144
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
base: main
Are you sure you want to change the base?
Paul.diaz/make spreadsheet component able to handle selection column #144
Conversation
@@ -174,6 +176,15 @@ export default function Spreadsheet (props) { | |||
] | |||
) | |||
|
|||
React.useEffect( | |||
() => onRowIsSelected && !initialRender.current && | |||
onRowIsSelected(selectedFlatRows.map(row => row.original)), |
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.
The map is probably unnecessary? Why not just send the whole row?
@@ -72,7 +72,7 @@ export default function SpreadsheetCell (props) { | |||
onBlur={evt => props.onBlur(evt, ctx)} | |||
{...props.cell.getCellProps()} | |||
> | |||
{value} | |||
{value || props.cell.render('Cell')} |
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.
This needs to be handled differently. What if the value is falsy?
@@ -1,6 +1,6 @@ | |||
import React from 'react' | |||
import { styled } from '@stitches/react' | |||
import { useTable, useFilters, useSortBy, usePagination } from 'react-table' | |||
import { useTable, useFilters, useSortBy, usePagination, useRowSelect } from 'react-table' |
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.
Line limit
onSelectCell={(evt, id) => !columnSelection && setSelectedCell(id)} | ||
onFocusCell={(evt, id) => !columnSelection && setFocusedCell(id)} |
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.
Line length
No description provided.