Skip to content

Can I keep selection when click outside the grid. #73

Answered by nick-keller
chairedevil asked this question in Q&A
Discussion options

You must be logged in to vote

Clicking the button blurs the grid before you have time to read the selection.
You can keep track of the selection in a state and then read the state when you need it:

const [lastSelection, setLastSelection] = useState(null)

return <DataSheetGrid onSelectionChange={selection => setLastSelection(selection ?? lastSelection)} />

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@nick-keller
Comment options

@chairedevil
Comment options

@chairedevil
Comment options

@nick-keller
Comment options

@kivircik-parantez
Comment options

Answer selected by nick-keller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants