mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-03 06:22:25 +02:00
Ability to toggle flipped state
This commit is contained in:
parent
2b85aa6bae
commit
0ce7c574ea
4
assets/scripts/dist/choices.min.js
vendored
4
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -36,6 +36,7 @@ export class Choices {
|
||||||
delimiter: ',',
|
delimiter: ',',
|
||||||
paste: true,
|
paste: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
flip: true,
|
||||||
regexFilter: null,
|
regexFilter: null,
|
||||||
placeholder: true,
|
placeholder: true,
|
||||||
placeholderValue: null,
|
placeholderValue: null,
|
||||||
|
@ -318,7 +319,7 @@ export class Choices {
|
||||||
this.dropdown.classList.add(this.config.classNames.activeState);
|
this.dropdown.classList.add(this.config.classNames.activeState);
|
||||||
|
|
||||||
const dimensions = this.dropdown.getBoundingClientRect();
|
const dimensions = this.dropdown.getBoundingClientRect();
|
||||||
const shouldFlip = dimensions.top + dimensions.height >= document.body.offsetHeight;
|
const shouldFlip = this.config.flip ? dimensions.top + dimensions.height >= document.body.offsetHeight : false;
|
||||||
|
|
||||||
// Whether or not the dropdown should appear above or below input
|
// Whether or not the dropdown should appear above or below input
|
||||||
if(shouldFlip) {
|
if(shouldFlip) {
|
||||||
|
|
Loading…
Reference in a new issue