Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

paulrrdiaz
Copy link

No description provided.

@@ -174,6 +176,15 @@ export default function Spreadsheet (props) {
]
)

React.useEffect(
() => onRowIsSelected && !initialRender.current &&
onRowIsSelected(selectedFlatRows.map(row => row.original)),
Copy link
Collaborator

@ianwalter ianwalter Aug 24, 2021

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')}
Copy link
Collaborator

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'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line limit

Comment on lines +281 to +282
onSelectCell={(evt, id) => !columnSelection && setSelectedCell(id)}
onFocusCell={(evt, id) => !columnSelection && setFocusedCell(id)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants