Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adanselm opened this issue Feb 17, 2025 · 0 comments
Open

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

adanselm opened this issue Feb 17, 2025 · 0 comments

Comments

@adanselm
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant