Keeping editor open while selecting

Tags: #<Tag:0x00007f8b28c43d48>

In Google Sheets, you can open the editor and enter = which then allows for navigation while the editor is open. I can use the arrow keys to select a cell, a range, or select cells with the mouse. All the while, the editor remains open.

We’re looking to implement similar functionality.

Is this possible within Handsontable? Any thoughts as to a viable approach would be appreciated.

Hi @adamjroth

At the moment Handsontable cell editor for a default cell closes when other cells are going to be selected. You can, however, create a custom cell editor that does it. I recommend starting here https://github.com/handsontable/handsontable/blob/d4f64e5e28620fe0a7fa7889ad975dfd920111c8/handsontable/src/editors/baseEditor/baseEditor.js#L396 with the base editor and the allowInvalid option cause it prevent from closing the cell editor base on a particular condition.

@aleksandra_budnik Thank you for the starting point.

I still need to wrap my head around this a bit more. Any more insight you can provide would be appreciated.

Consider the attached gif from Google Sheets. The editor is open, and maintains focus, while certain keyboard events are seemingly forwarded to the underlying grid.

Alphanumeric keystrokes are received by the editor/text input, but navigational keystrokes move around the selection.

Do you or your team have any thoughts as to the best way to approach this with HOT? I don’t mind writing a custom editor, but any direction from your end would help.

navWhileOpenGif

As bad as I would like to help, there is not much I can share. We do not have a similar demo in the demo base, and I did not find a conversation with any tips or demos in the history of our open communication channels.

No worries, thank you though!

1 Like