Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

EZP-31347: Added functionality to show dropdown above select field #1218

Merged

Conversation

GrabowskiM
Copy link
Contributor

@GrabowskiM GrabowskiM commented Jan 31, 2020

Question Answer
Tickets https://jira.ez.no/browse/EZP-31347
Bug fix? yes
New feature? no
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

Select list now will be positioned above select field if there is less than 300px to the bottom of screen.

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

if (isListHidden) {
const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
const { top } = this.itemsContainer.getBoundingClientRect();

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change


this.itemsContainer.classList.toggle(CLASS_ITEMS_HIDDEN);
doc.body[methodName]('click', this.onClickOutside, false);

const bodyMethodName = isListHidden ? 'addEventListener' : 'removeEventListener';
Copy link
Member

Choose a reason for hiding this comment

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

can be moved before the iff to the other const

@GrabowskiM GrabowskiM requested a review from dew326 February 3, 2020 08:07
@@ -8,6 +8,8 @@
&__items {
border: none;
box-shadow: 0 calculateRem(2px) calculateRem(4px) 0 rgba(0, 0, 0, 0.45);
max-height: calculateRem(300px);
overflow-y: scroll;
Copy link
Member

Choose a reason for hiding this comment

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

always scroll? I think better will be auto

@GrabowskiM GrabowskiM requested a review from dew326 February 3, 2020 10:07
@lserwatka lserwatka merged commit ba46417 into ezsystems:1.5 Feb 3, 2020
@lserwatka
Copy link
Member

Could you merge it up?

@GrabowskiM
Copy link
Contributor Author

Merge up done.

# for free to join this conversation on GitHub. Already have an account? # to comment
Development

Successfully merging this pull request may close these issues.

5 participants