ng2-semantic-ui icon indicating copy to clipboard operation
ng2-semantic-ui copied to clipboard

How to make upward open dropdown?

Open tempurai opened this issue 7 years ago • 5 comments

Hi, thank you for this great repo.

I am having some trouble make a upward open dropdown, all examples I saw only have down, left and right opening dropdown. How can we make a upward one, which is very important when we have dropdown/selector on footer?

Thanks!

tempurai avatar May 10 '18 14:05 tempurai

Is this page of any help here? Most of the CSS stuff is out of the scope of this library, and handled by S-UI itself.

edcarroll avatar Aug 23 '18 18:08 edcarroll

@edcarroll : I tried on the official doc page the « States » dropdown.

Step 1 - When the dropdown is on top of the page, the dropdown menu is displayed under the dropdown button. Step 2 - When scrolling in order to move the button near the footer, the dropdown is displayed above the button.

I've tried the same procedure on your doc site (https://edcarroll.github.io/ng2-semantic-ui/#/modules/select) with the « Basic » dropdown and the Step 2 does not move the dropdown menu above.

So I think it's not a CSS related problem. Original SUI should probably use a positioning jQuery library to check the dropdown position.

PapsOu avatar Aug 31 '18 09:08 PapsOu

I have the same problem. When the dropdown is at the bottom of the page it tries to open it down, in the normal version of semantic-ui it detects that it has no space and opens up. Has anyone found a solution?

kaoecoito avatar Oct 31 '18 16:10 kaoecoito

After reading the original source JQuery and comparing with how it is done in the version in Angular I understood how to solve this problem. Basically a combination of CSS with the transition type change generates the expected effect. In the JQuery version is used auto detection that is not present in the Angular version.

In div with use suiDropdown add class upward

<div class="ui primary upward dropdown button" suiDropdown autofocus>

In div with use suiDropdownMenu add attribute menuTransition="slide up"

<div class="menu" suiDropdownMenu menuTransition="slide up">

kaoecoito avatar Oct 31 '18 17:10 kaoecoito

After reading the original source JQuery and comparing with how it is done in the version in Angular I understood how to solve this problem. Basically a combination of CSS with the transition type change generates the expected effect. In the JQuery version is used auto detection that is not present in the Angular version.

In div with use suiDropdown add class upward

<div class="ui primary upward dropdown button" suiDropdown autofocus>

In div with use suiDropdownMenu add attribute menuTransition="slide up"

<div class="menu" suiDropdownMenu menuTransition="slide up">

Thanks Kaoecoito, Your understanding solved my problems too.

hansnath3 avatar Sep 20 '21 08:09 hansnath3