-
Notifications
You must be signed in to change notification settings - Fork 55
fix(radio-group): replaced label with content #287
Conversation
5d25c9d
to
9b0b48b
Compare
Codecov Report
@@ Coverage Diff @@
## master #287 +/- ##
==========================================
+ Coverage 89.49% 89.54% +0.05%
==========================================
Files 62 62
Lines 1171 1177 +6
Branches 152 175 +23
==========================================
+ Hits 1048 1054 +6
Misses 121 121
Partials 2 2
Continue to review full report at Codecov.
|
111d0af
to
d2a8a3e
Compare
d2a8a3e
to
8b6c080
Compare
@@ -172,7 +172,7 @@ class RadioGroupItem extends AutoControlledComponent<Extendable<IRadioGroupItemP | |||
onClick={this.handleClick} | |||
className={classes.root} | |||
> | |||
<Label styles={styles.label}> | |||
<Label styles={styles.content}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit worrying about semantics behind this nesting here. Do we really want the content (that is quite generic by its nature) to be always a children of Label
(and, thus, to always reflect its styles and, what is more important, behavioural and accessibility aspects - for any arbitrary value of content
that will be passed in)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not changing the implementation as you can see, just the name of the prop (I should have kept the name of the styles slot to label
, will revert that part).
I think this is a legitimate concern, but the nature of the radio button dictates to us that we need an icon
with some content
after it; maybe we should not use Label
to wrap these, any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I would suggest exactly the same path as you've done - specifically, to not wrap Icon with Label (especially if we would take into account where Icon is used - it is used to 'fill' the circle area of radio input). Then it would be much easier to decouple all these parts from each other.
Not sure if we should do it in this PR or create a dedicated one as a close follow-up, but the most important thing would be, actually, if we all agree on that proposal :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather do it in another PR; I'll discuss with @jurokapsiar as well to understand what are the concerns (if any) and proceed with removing Label
497e9cc
to
ff2c72c
Compare
ff2c72c
to
7cde30d
Compare
src/components/Input/Input.tsx
Outdated
@@ -180,7 +180,7 @@ class Input extends AutoControlledComponent<Extendable<IInputProps>, any> { | |||
|
|||
return ( | |||
<ElementType className={classes.root} {...restProps} onChange={onChange}> | |||
{createHTMLInput(type, { | |||
{createHTMLInput(input || type, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have we agreed to have this input
prop for the Input
element (like as it is in SUIR)? We've had some concerns - specifically, the fact that it makes it non-intuitive for the client what input
prop of Input
component is about. Maybe we should leave it for a dedicated PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally agree with the changes made, but it seems that there is more changes than necessary to address the goal of this PR. Would rather suggest to do it step-by-step - or to discuss those additional concepts introduced, as those might raise some concerns (have expressed them in comments)
15fa36d
to
aee235e
Compare
docs/src/examples/components/RadioGroup/Types/RadioGroupExample.shorthand.tsx
Outdated
Show resolved
Hide resolved
aee235e
to
e6837cb
Compare
Radio group
This PR contains:
label
prop withcontent
content
accept react nodes as valueTODO