I’m working on a Chrome extension, with Select2 4.1.0-rc.0.
When I focus a select2 (multi, tags) input, the suggestion dropdown shows up, and if I press esc
then it closes. So far so good. Issue is, if I press esc
again, instead of re-opening the dropdown tags list, it closes the popup…
Here’s the instantiation of Select2
tagSelect.select2({
placeholder: "Tag paper...",
maximumSelectionLength: 5,
allowClear: true,
tags: true,
width: "75%",
tokenSeparators: [',', ' '],
dropdownParent: $(`#memory-item-container--${eid}`)
});
I’ve tried everything I could think of: I can’t catch the select2 keydown events with $(document).keydown((e) =>{ e.preventDefault()})
, handling the select2:closing
event to remove select2
control over keydown (with something like tagSelect.off("keydown")
), I added this dropdownParent
hoping it would allow $(document).keydown
to still work etc.