Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Button): Add bool to propTypes of attached #2105

Merged
merged 3 commits into from
Sep 23, 2017

Conversation

kasbah
Copy link
Contributor

@kasbah kasbah commented Sep 22, 2017

fixes #2104

@levithomason
Copy link
Member

Looks like we may also need to update the ButtonGroup.

@codecov-io
Copy link

codecov-io commented Sep 22, 2017

Codecov Report

Merging #2105 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2105   +/-   ##
=======================================
  Coverage   99.76%   99.76%           
=======================================
  Files         149      149           
  Lines        2598     2598           
=======================================
  Hits         2592     2592           
  Misses          6        6
Impacted Files Coverage Δ
src/elements/Button/ButtonGroup.js 100% <ø> (ø) ⬆️
src/elements/Button/Button.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2fc8f5...ef82ce7. Read the comment docs.

@kasbah
Copy link
Contributor Author

kasbah commented Sep 22, 2017

Looks to me like Button.Group doesn't attach properly in the middle currently so the warning is kind of appropriate? https://codepen.io/anon/pen/KXgrLd?editors=1111

@kasbah
Copy link
Contributor Author

kasbah commented Sep 22, 2017

Weirdly enough, any other string will work. 😕 https://codepen.io/anon/pen/KXgbpz?editors=1111

EDIT: also some issues with the attaching of the group in general: the left side isn't rounded at all no matter what.
image

EDIT2: nvm, that's a known issue with single button groups

@kasbah
Copy link
Contributor Author

kasbah commented Sep 22, 2017

I pushed a commit that I think fixes the handling for ButtonGroup. Seems like the CSS has no issues with middle attached groups so it should be fine, but I don't really know what I am doing, just copying and pasting things that seem to make sense and I don't yet know how to best do a manual check if this behaves as desired.

Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kasbah Thanks for PR, I've left some comments about styling. Also, Button should also use useKeyOrValueAndKey and use corresponding test.

@@ -10,6 +10,7 @@ import {
SUI,
useKeyOnly,
useValueAndKey,
useKeyOrValueAndKey,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort members in alphabetical order, i.e.:

useKeyOnly,
useKeyOrValueAndKey,
useValueAndKey,

useValueAndKey(floated, 'floated'),
useKeyOrValueAndKey(attached, 'attached'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^, same there

@@ -13,7 +13,8 @@ describe('ButtonGroup', () => {
widthClass: 'buttons',
})

common.propKeyAndValueToClassName(ButtonGroup, 'attached', ['left', 'right', 'top', 'bottom'])
common.propKeyOrValueAndKeyToClassName(ButtonGroup, 'attached', ['left', 'right', 'top', 'bottom'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there 😄

@kasbah
Copy link
Contributor Author

kasbah commented Sep 23, 2017

Thanks @layershifter, I fixed the code style issues. Button is already using useKeyOrValueAndKey, that's where I copied it from. ;)

@layershifter
Copy link
Member

@kasbah Shame to me 🐰 I've retriggered build, now it passed successfully. Great job 👍

@levithomason levithomason merged commit 0c66410 into Semantic-Org:master Sep 23, 2017
@levithomason
Copy link
Member

Released in semantic-ui-react@0.74.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button: attached prop should accept true as value
4 participants