ce icon indicating copy to clipboard operation
ce copied to clipboard

Clear multiple cells results in an error

Open zacherkkila opened this issue 3 years ago • 3 comments

Trying to clear multiple as mentioned in an issue earlier on

    const handleKeydown = (e: KeyboardEvent) => {
        if (spreadsheet) {
            if (spreadsheet.edition) {
                if (e.code === 'Backspace') {
                    spreadsheet.setValue(spreadsheet.getHighlighted(), '', false);
                    e.stopPropagation();
                }
            }
        }
    }

The delete works fine but onBlur I am getting the error below. I am using a fixed column definition set in options

TypeError: undefined is not an object (evaluating 'cell.children[0].value')

Any insight you can give would be greatly appreciated

zacherkkila avatar Feb 15 '22 17:02 zacherkkila

Are you using any custom editor?

hodeware avatar Feb 17 '22 21:02 hodeware

I don't know if any of you still have this issue. But I have managed to fix it. It is because only delete key is supported. You need to add the backspace key to the delete condition.

Code is here

mccp avatar Jun 07 '23 09:06 mccp

Interesting, sorry I forgot to respond here @hodeware.. It is a small part of our product so I turned it off bulk delete and then it got left in the dust.. Thanks for looking @mccp, will look to add this in if the PR gets approved..

I was running this on an MBP as well

zacherkkila avatar Jun 09 '23 14:06 zacherkkila