Semantic UI dropdown - how to position it to the left of the opening link?

11,362

Solution 1

It is possible to do it by adding pointing class to the dropdown.

You can find a JSFiddle example here: http://jsfiddle.net/ypvpajrL/

Source: https://github.com/Semantic-Org/Semantic-UI/issues/3645

Solution 2

Add this style next to menu class

style="right: 0;left: auto;"

example;

    <div class="ui simple dropdown icon button" style="margin:0;"> 
       <i class="calendar icon"></i>
            Date
        <div class="menu" style="right: 0;left: auto;">
        <a class="ui item">Today</a>
        <a class="ui item">Yesterday</a>
        </div>
    </div>
Share:
11,362
Kokesh
Author by

Kokesh

PHP/MySQL developer

Updated on July 18, 2022

Comments

  • Kokesh
    Kokesh almost 2 years

    I would like to open the dropdown to the left of the link opening the dropdown, so it is visible on tiny screens like iPhone has. Is there some standard way to do it?

    Here is my dropdown definition - it would be nice to get some setting(class) telling the dropdown to align right, not left side with the link.

    <div class="four wide mobile three wide computer column">
        <div class="ui compact dropdown doNotClose">
            <i class="dropdown icon"></i>
            <span class="ui tiny header">Filters</span>
            <div class="menu">
                <div class="item">
                    <div class="ui toggle checkbox">
                        <input type="checkbox" checked>
                        <label>Acknowledge</label>
                    </div>
                </div>
                <div class="item">
                    <div class="ui toggle checkbox">
                        <input type="checkbox" checked>
                        <label>Active</label>
                    </div>
                </div>
            </div>
        </div>
    </div>
    

    enter image description here