AUI Dropdown with scrollbar

Frédéric Tardieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2014

Hi all,

Is it possible to have scrollable options list when using an AUI dropdown (https://docs.atlassian.com/aui/latest/docs/dropdown2.html), as for a normal html <select>?

When the option list is too long, it may go outside screen bottom, and some options may be impossible to reach...

Thanks,

Fred

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Frédéric Tardieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2014

Hi,

I found how to do this: adding overflow & max-height CSS properties, like this (from AUI Sandbox Dropdown example):

&lt;!-- Simple Dropdown - trigger --&gt;
&lt;p&gt;
&lt;a href="#dwarfers" aria-owns="dwarfers" aria-haspopup="true" class="aui-button aui-dropdown2-trigger aui-style-default"&gt;Shipmates&lt;/a&gt;&lt;/p&gt;
&lt;!-- Simple Dropdown - dropdown --&gt;
&lt;div id="dwarfers" class="aui-dropdown2 aui-style-default" style="overflow:auto;max-height:150px;"&gt;
    &lt;ul class="aui-list-truncate"&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Lister&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Rimmer&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Cat&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Kryten&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Lister&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Rimmer&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Cat&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Kryten&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Lister&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Rimmer&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Cat&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Kryten&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Lister&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Rimmer&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Cat&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Kryten&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Lister&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Rimmer&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Cat&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Kryten&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Lister&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Rimmer&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Cat&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://example.com/"&gt;Kryten&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;&lt;!-- .aui-dropdown2 --&gt;

0 votes
Anil June 6, 2019

Just add below

style="overflow:auto;max-height:150px;"

0 votes
Yagnesh Bhat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2014

Hi Frederic,

Try tweaking this in the atlassian sandbox : https://docs.atlassian.com/aui/latest/sandbox/#. Check out the Dropdown library under this.

All these are the only available GUI options of the Atlassian products.

TAGS
AUG Leaders

Atlassian Community Events