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

Feature : add 'size' option for custom dropdown height #1875

Merged
merged 4 commits into from
Sep 27, 2022
Merged

Feature : add 'size' option for custom dropdown height #1875

merged 4 commits into from
Sep 27, 2022

Conversation

fabienwnklr
Copy link
Contributor

new 'size' option to set dropdown size, can be a number to displayed items, or a simple CSS height (px, rem, em, vh)

I also added two tests for value as number of items displayed and CSS value

Default value is false so nothing change

Open to improvement and patch

@eduardo-mior
Copy link

eduardo-mior commented Sep 23, 2022

Some time ago I needed this too.

I solved this with 1 line of CSS:

.my-selectize .selectize-dropdown-content {
     max-height: none !important;
}

or

.my-selectize .selectize-dropdown-content {
     max-height: 450px !important;
}

I particularly think that this kind of problem should be solved via CSS not JS.

@fabienwnklr
Copy link
Contributor Author

Yes for simple height it's easily doable with CSS,I implemented that CSS values be accepted for better customization and flexibility. But first improvement and first idea it's to set a count of visible value, like 5 items visible etc.

Let's see what owner think about that !

Copy link
Contributor

@risadams risadams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a couple of questions here. Also Thanks for adding tests! :)

src/defaults.js Outdated Show resolved Hide resolved
src/selectize.js Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

3 participants