outsideClickDeselect - prevent removal of row highlight

Tags: #<Tag:0x00007f8b18745310>

Hi,

Currently, when a user clicks on a cell, we are highlighting the whole row by adding a hook for afterSelectionEnd.

outsideClickDeselect is set to false, as we always want the last selected row to be highlighted.

However, when an outside click is detected, it removes all of the rows highlight apart from the one cell that was originally clicked.

How can i prevent this?
afterDeselect is not firing because outsideClickDeselect is set to false so im not sure which hook is being fired when an outside click is detected?

Thanks

Hi @reasy

I’ve made an example here https://jsfiddle.net/pycmxnza/ but once I click a cell and then click an input or a button selection is still present.

Do you use any other logic (or an older version of Handsontable)?

Thanks @aleksandra_budnik,

When i have the following option enabled as i only want to be able to select 1 row at a time, the code breaks with javascript errors:

selectionMode: ‘single’,

And it should break. The definition of ‘single’ is

  • 'single' Only a single cell can be selected.

If you want to select only one row, that’s OK. It’s doable like this https://jsfiddle.net/s7fo9ybm/

I’m closing this issue as there is no feedback for more than a month.
If you still need any guidance, please create a new ticket or message me at support@handsontable.com