Skip to content

Please add a feature to limit visible select list options #10

@yaddly

Description

@yaddly

Hi, thank you for this indispensable or requisite select plugin. It is the most functional plugin on the internet I could find that actually works and supports bootstrap dark and light mode themes.

I have a few ideas below to make this plugin more customizable.

  1. May you please consider adding a feature that limits the size of visible select list options. Currently the size attribute is not respected and all options are visible.

  2. May you please consider adding a feature that allows hiding the dropdown options from being visible unless they match the first 2 or 3 characters of what the user is typing. This will give users a true feel and behaviour that one gets when using google searching engine.

  3. May you please consider horizontal scrolling behaviour especially when the select element has a lot of options to display or show, they occupy less space compared to vertical scrolling.

  4. May you consider allowing the initialization of multiple select elements using the array syntax e.g. new UseBootstrapSelect([...]) to avoid having to loop through matching elements as below.

const initializeElements = () => {
    const elements = document.querySelectorAll(".form-select");
    selects = Array.from(
        elements,
        (element) => new UseBootstrapSelect(element)
    );
};
  1. May you please consider allowing the clearing of multiple select elements using the array syntax and a static method e.g. UseBootstrapSelect.clearValues([...]) to avoid keeping references to initialized select elements and using a loop to clear elements.
const clearSelectValues = () => {
    selects.forEach((select) => select.clearValue());
};

Screenshot 2024-06-17 172045

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions