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

Drop-down list increase page height #780

Closed
uCryNet opened this issue Nov 25, 2019 · 2 comments
Closed

Drop-down list increase page height #780

uCryNet opened this issue Nov 25, 2019 · 2 comments
Labels

Comments

@uCryNet
Copy link

uCryNet commented Nov 25, 2019

Describe the bug
If the select is at the bottom of the page, then the drop-down list can “pull” the page down

Expected behavior
He must not add height

Screenshots
1
2

Desktop:

  • OS: Linux
  • Browser: Chromium, FireFox
  • Version: 78.0.3904.97, 70.0.1
@uCryNet uCryNet added the bug label Nov 25, 2019
@uCryNet
Copy link
Author

uCryNet commented Nov 25, 2019

Possible Solution:
CSS:

.choices__list--dropdown {
  height: 0; /* added this */
}

JS:

_proto.show = function show() {
    this.element.classList.add(this.classNames.activeState);
    this.element.style.height = 'auto' // added this
    this.element.setAttribute('aria-expanded', 'true');
    this.isActive = true;
    return this;
  }
_proto.hide = function hide() {
    this.element.classList.remove(this.classNames.activeState);
    this.element.style.height = '0' // added this
    this.element.setAttribute('aria-expanded', 'false');
    this.isActive = false;
    return this;
  };

@uCryNet uCryNet changed the title Drop-down list increases page height Drop-down list increase page height Nov 25, 2019
@jshjohnson jshjohnson mentioned this issue Nov 27, 2019
8 tasks
@ch3rn1k
Copy link

ch3rn1k commented Dec 2, 2019

Another possible solution via only CSS:

.choices__list--dropdown {
  height: 0;
}

.choices__list--dropdown.is-active {
  height: auto;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants