Is there a way to preserve table selection when clicking on something outside the table, e.g. button? The default behaviour is when you click button selected cells become unselected and getSelected() returns undefined value.
yes, you can use outsideClickDeselects option and set it to false. Documentation https://handsontable.com/docs/7.0.0/Options.html#outsideClickDeselects
Thanks, Aleksandra! Missed that option in documentation - been searching for "selection".