-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add helpertext to select #696
Conversation
classes: this.theme(this.getRootClasses()) | ||
}, labelAfter ? children.reverse() : children); | ||
useNativeElement ? this.renderNativeSelect() : this.renderCustomSelect(), | ||
w(HelperText, { theme, text: helperText }) |
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.
Would you want to conditionally render the helper text widget? Something like helperText ? w(HelperText, { theme, text: helperText }) : null
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 wanted to render it at all times. The helpertext has both a root and a conditional text node. The reasoning behind this was to allow the consumer to theme it to reserve it's space if they wish in order to stop the UI jumping around if they helpertext shows / hides. In reality, it's best practise to always show a helperText for a widget that will be validated.
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.
Got it, alright 👍
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 guess the render possess is cheap enough where you don't need to worry about that then
5d5f21d
to
9ab46f2
Compare
Codecov Report
@@ Coverage Diff @@
## master #696 +/- ##
=========================================
Coverage ? 98.98%
=========================================
Files ? 45
Lines ? 3337
Branches ? 928
=========================================
Hits ? 3303
Misses ? 34
Partials ? 0
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #696 +/- ##
==========================================
- Coverage 99.04% 99.04% -0.01%
==========================================
Files 45 45
Lines 3344 3335 -9
Branches 927 926 -1
==========================================
- Hits 3312 3303 -9
Misses 32 32
Continue to review full report at Codecov.
|
@@ -223,7 +225,8 @@ const expected = function(selectVdom: any, { classes = [ css.root, null, null, n | |||
required: undefined, | |||
forId: '' | |||
}, [ 'foo' ]) : null, | |||
selectVdom | |||
selectVdom, | |||
w(HelperText, { theme: undefined, text: helperText }) |
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.
Do you need to have theme as a property here?
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.
Don't we want to pass the actual theme through here?
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.
thats a test @agubler
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.
Urgh my bad, damn not using a top level test directory... that’s what I checked for 😂
Type: feature
The following has been addressed in the PR:
Description:
helperText
property toSelect
labelAfter
as not compatible withhelperText
Part of: #677