Skip to content

Combo Box remote options mode erases tom select's load callback #402

Open
@adanselm

Description

@adanselm

I'd like to combine remote options with the virtual scroll tom select plugin, which requires a custom load callback.
I can't do that because the combo-box-hook.js replaces this callback even if it's defined in my globalOpts:

    if (remoteOptionsEventName) {
      tomSelectOptions.load = (query, callback) => {
        const handleServerReply = (payload, ref) => {
          const resultsJSON = payload.results.map(({ text, value }) => ({
            text,
            value,
          }));

          callback(resultsJSON);
        };

Behaviour could be to not overwrite the callback if I defined my own in globalOpts and let me handle the complex loading on my own (if that's even possible in tom select to use both plugins at the same time).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions