This repository was archived by the owner on Jun 1, 2025. It is now read-only.
feat(multiselect): auto-adjust height, width & position of multiple-select.js #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
multiple-select.js
and remove previous code (that was not always working) new flags are:autoAdjustDropHeight
autoAdjustDropPosition
autoAdjustDropWidthByTextSize
multiple-select.js
you might want to use certain minimum or maximum height/width, so we also added the following options:minWidth
(defaults to null, to use whenautoAdjustDropWidthByTextSize
is enabled)maxWidth
(defaults to 500, to use whenautoAdjustDropWidthByTextSize
is enabled)adjustHeightPadding
(defaults to 10, to use whenautoAdjustDropHeight
is enabled)maxHeight
(defaults to 275, to use whenautoAdjustDropHeight
is enabled)Default Behaviors
autoAdjustDropWidthByTextSize
will loop through every text from thecollection
and calculate it's maximum width.maxWidth
, it will instead use themaxWidth
value.minWidth
, it will instead use theminWidth
value.select
DOM element, it will use theselect
element width in this caseautoAdjustDropHeight
is enabled andautoAdjustDropPosition
is enabledmaxHeight
, it will then choose which of the area has the most space (top or bottom)autoAdjustDropHeight
is enabled andautoAdjustDropPosition
is disabled