It appears that my select2 remains the active element after closing by default. That’s fine and what you’d expect, but it also captures the space bar and enter key when focused which are not desired in my application.
To address this and hopefully un-focus the select2, I have an on:change event for the select2 where I try to focus() some other element than my select2 or blur() the select2. This seems to work, as when I step through with my debugger I see document.activeElement change to the new element. However at some unspecified time later, the active element becomes “select2-selection select2-selection–single” again. I’ve not managed to step through to catch when this happens yet, but it might just be a matter of time if the cause of this is set to trigger as a callback or whatever.
I also tried moving the on:change to on:close, no change in results.
Is there some setting I can use to disable focus on a select2 after a selection is made? Or, more directly to the point, is there a way to just disable the function of spacebar after a selection is made?
Thanks in advance.