Closed unhammer closed 4 years ago
It seems I don't need to trigger it myself, as long as I can override Quill's other tab-handlers:
quill.keyboard.addBinding(
{
key: 9
},
function(_range, _context) {
// Run the other handlers iff no dropdown:
return $('.textcomplete-dropdown').filter(":visible").length === 0;
}
);
// Give it priority over the other handlers:
quill.keyboard.bindings[9].unshift(quill.keyboard.bindings[9].pop())
This works for my case (though I still feel like it should be possible to trigger the select from code).
Thanks a lot @unhammer! It worked for me.
How can I manually fire select on the active drop-down? I'm considering using this with https://quilljs.com/ which of course defines its own handlers for tab in list-indentation contexts etc.; and I'd like to define a tab-handler that does completion iff there's a drop-down, otherwise runs through the other handlers.