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

[Bug]: maxOptions now accepting any values, and my droplist stays limited to the first 50 items #669

Open
ogarocious opened this issue Dec 3, 2023 · 2 comments
Labels
bug Something isn't working stale No activity

Comments

@ogarocious
Copy link

ogarocious commented Dec 3, 2023

Bug description

Despite trying multiple setting for maxOptions (I've tried null, false, '', and even an integer of 500 & 1000000 and my dropdown field for my site is still being limited to 50 items.

When I remove the select-dancestyle if from the dropdown field in my Rails app, I lose the TomSelect JS look and my list of dance styles is completee.

  <%= f.select :dance_style_ids, DanceStyle.sorted.all.pluck(:name, :id),
    { label: "What are the main dance styles that will be represented at this event?",
      help: "Select the main dance styles that will be represented in the classes and/or socials." }, 
    { multiple: true, id: "select-dancestyle" } %>
const selectDancestyle = document.getElementById('select-dancestyle');
if (selectDancestyle) {
  new TomSelect(selectDancestyle, {
    maxOptions: 500,
    plugins: {
      remove_button: {
        title: 'Remove this dance style.'
      }
    },
    onItemAdd: function () {
      this.setTextboxValue('');
      this.refreshOptions();
    },
  });
}

The plugin for remove button is working.

Expected behavior

When I remove the select-dancestyle if from the dropdown field in my Rails app, I lose the TomSelect JS look and my list of dance styles is complete.

I'm expecting my list of dance styles to show completely, instead of being limited to 50.

Steps to reproduce

I have a separate tomselect.JS file that's being used in my Rails App, versus the JS code being on my same view page.

Additional context

This is an issue thats occuring on my deployed website.

  • OS: MacOS Sonoma
  • Browser: This issue appears regardless of my browser, I've tested on Chrome, Firefox, and Safari.
@ogarocious ogarocious added the bug Something isn't working label Dec 3, 2023
@ogarocious ogarocious changed the title [Bug]: maxOptions now accepting any vallues [Bug]: maxOptions now accepting any values, and my droplist stays limited to the first 50 items Dec 3, 2023
@philgyford
Copy link

FWIW, I just noticed that my drop-downs were limited to 50 options. I realised I hadn't set maxOptions at all, set it to null, and now all of my many options are shown. So Tom Select seems to be working in this regard for me, anyway. Perhaps it's something else affecting your dropdown?

v.2.3.1.

Copy link

This issue has not been active in 120 days and has been marked "stale". Remove stale label or comment or this will be closed in 15 days

@github-actions github-actions bot added the stale No activity label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale No activity
Projects
None yet
Development

No branches or pull requests

2 participants