Skip to content

Implement custom editor for some (not all) text cells #448

Answered by jassmith
ssvendsen asked this question in Q&A
Discussion options

You must be logged in to vote
  provideEditor: () => p => {
        const { isHighlighted, onChange, value } = p;
        return (
            <TextCellEntry
                highlight={isHighlighted}
                autoFocus={true}
                value={value.data.YOUR_CUSTOM_CELL_DATA_PROP ?? ""}
                onChange={e =>
                    onChange({
                        ...value,
                        data: {
                            ...value.data,
                            name: e.target.value,
                        },
                    })
                }
            />
        );
    },

Thats pretty much the text-cell editor code. We often do this in our own custom cells.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jassmith
Comment options

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