Semantic-ui-react: Floating dropdown with button doesn't behave properly

Created on 30 May 2017  路  2Comments  路  Source: Semantic-Org/Semantic-UI-React

Steps

import React from 'react'
import { Button, Dropdown } from 'semantic-ui-react'

const options = [
  { key: 'edit', icon: 'edit', text: 'Edit Post', value: 'edit' },
  { key: 'delete', icon: 'delete', text: 'Remove Post', value: 'delete' },
  { key: 'hide', icon: 'hide', text: 'Hide Post', value: 'hide' },
]

const DropdownExampleFloating = () => (
  <Button.Group color='teal'>
    <Button>Save</Button>
    <Dropdown options={options} floating button className='icon' />
  </Button.Group>
)

export default DropdownExampleFloating

Expected Result

screen shot 2017-05-30 at 12 47 30 am

Above screenshot from: https://semantic-ui.com/modules/dropdown.html

Actual Result

The text of the dropdown sections shows up in the button area.
screen shot 2017-05-30 at 12 44 59 am

Above screenshots from: https://react.semantic-ui.com/modules/dropdown#dropdown-example-floating

Version

0.68.4

bug docs stale

Most helpful comment

@jtokoph Thanks for your eyes. It's happens because Dropdown will always render text which will contain a current value or a trigger element.

Here is workaround for this issue, however it's a very dirty solution.

  <Button.Group color='teal'>
    <Button>Save</Button>
    <Dropdown options={options} floating button className='icon' trigger={<div />} />
  </Button.Group>

All 2 comments

@jtokoph Thanks for your eyes. It's happens because Dropdown will always render text which will contain a current value or a trigger element.

Here is workaround for this issue, however it's a very dirty solution.

  <Button.Group color='teal'>
    <Button>Save</Button>
    <Dropdown options={options} floating button className='icon' trigger={<div />} />
  </Button.Group>

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

jeffcarbs picture jeffcarbs  路  53Comments

dylankiss picture dylankiss  路  22Comments

brianespinosa picture brianespinosa  路  21Comments

callain picture callain  路  22Comments

levithomason picture levithomason  路  39Comments