Skip to content

Commit

Permalink
fix(Button): render labeled as a <button> (#597)
Browse files Browse the repository at this point in the history
* Update Button.js

fix switch button to div

* add test button labeled icon

* Simplified test

* add space
  • Loading branch information
dmitriyshx authored and levithomason committed Oct 3, 2016
1 parent 3087ad1 commit b22e138
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/elements/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function Button(props) {

const rest = getUnhandledProps(Button, props)
const ElementType = getElementType(Button, props, () => {
if (label || labeled || attached) return 'div'
if (label || attached) return 'div'
})
const tabIndex = ElementType === 'div' ? 0 : undefined

Expand Down
7 changes: 7 additions & 0 deletions test/specs/elements/Button/Button-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,11 @@ describe('Button', () => {
wrapper.children().at(1).should.match('.ui.label')
})
})

describe('labeled', () => {
it('renders as a button', () => {
const wrapper = shallow(<Button labeled />)
wrapper.should.have.tagName('button')
})
})
})

0 comments on commit b22e138

Please sign in to comment.