Semantic-ui-react: Dropdown: item clipped if positioned right of a Menu

Created on 25 Jul 2017  路  4Comments  路  Source: Semantic-Org/Semantic-UI-React

Steps

Create a top menu bar with the last item being a dropdown and with position ="right".
Some of the downdown's items have a long content

Expected Result

The dropdown is displayed completely and not clipped when expanded

Actual Result

The dropdown items are clipped and not fully visible

Version

0.71.1

Testcase

https://codepen.io/youbi/pen/RZNWjz

enhancement good first issue help wanted stale

Most helpful comment

The Dropdown currently does not support menu direction. PRs welcome.

The Fix

We need to add a direction prop to the Dropdown.Menu which simply adds the left className when direction='left'.

We then need to also add a direction prop to the Dropdown. The Dropdown would pass the direction value to the Dropdown.Menu when rendering it. The CSS will then open it on the correct side.

A Workaround

Adding an inline style to the Dropdown.Menu will get the results you need for now:
https://codepen.io/levithomason/pen/XaXjma

<Dropdown.Menu style={{ left: 'auto', right: 0 }}>

Note that in future versions we are considering deprecating the Dropdown sub component API. We would then have only props for defining the menu and items. This will only happen if we can support all features via props, but I wanted to make you aware.

All 4 comments

The Dropdown currently does not support menu direction. PRs welcome.

The Fix

We need to add a direction prop to the Dropdown.Menu which simply adds the left className when direction='left'.

We then need to also add a direction prop to the Dropdown. The Dropdown would pass the direction value to the Dropdown.Menu when rendering it. The CSS will then open it on the correct side.

A Workaround

Adding an inline style to the Dropdown.Menu will get the results you need for now:
https://codepen.io/levithomason/pen/XaXjma

<Dropdown.Menu style={{ left: 'auto', right: 0 }}>

Note that in future versions we are considering deprecating the Dropdown sub component API. We would then have only props for defining the menu and items. This will only happen if we can support all features via props, but I wanted to make you aware.

is the ticket available can i contribute to this issue ?

@mprambadi I've not seen a PR for this yet. I think you're in the clear.

Dropdown PRs

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

levithomason picture levithomason  路  39Comments

imns picture imns  路  40Comments

the-simian picture the-simian  路  24Comments

cytey picture cytey  路  24Comments

fuwywawyuh picture fuwywawyuh  路  24Comments