Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Selectize field (not dropdown) max height #1735

Closed

Description

@reformed

Is there a way to limit the max height of a Selectize field? The field itself, not the dropdown. The field in question needs to allow all options to be selected, so the option maxItems cannot be used. The maxOptions option can't be used either because that applies to the dropdown.

Is there a way to reduce the height of a field like this?

Screenshot of example

Example:

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.13.3/css/selectize.min.css">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.13.3/css/selectize.bootstrap3.min.css" rel="stylesheet" />

    <div id="container" style="max-width: 400px;">
      <form>
        <select id="selectize" name="selectize" class="form-control" multiple></select>
        <button type="submit" class="btn btn-success">Submit</button>
      </form>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.13.3/js/standalone/selectize.min.js"></script>
    <script>
        (function($select) {
          for (let i = 100; i < 202; ++i) {
            $select.append('<option value="' + i + '" selected>Test ' + i + '</option>');
            $select.append('<option value="' + (2 * i) + '">Test ' + (2 * i) + '</option>');
          }

          $select.selectize();
        })($("#selectize"));
    </script>

Activity

  1. locked and limited conversation to collaborators on Jan 24, 2022
  2. converted this issue into a discussion #1736 on Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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