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

Add helpertext to select #696

Merged
merged 2 commits into from
Apr 9, 2019
Merged

Add helpertext to select #696

merged 2 commits into from
Apr 9, 2019

Conversation

tomdye
Copy link
Member

@tomdye tomdye commented Mar 22, 2019

Type: feature

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

  • Adds helperText property to Select
  • Removes labelAfter as not compatible with helperText

Part of: #677

classes: this.theme(this.getRootClasses())
}, labelAfter ? children.reverse() : children);
useNativeElement ? this.renderNativeSelect() : this.renderCustomSelect(),
w(HelperText, { theme, text: helperText })
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, alright 👍

Copy link
Contributor

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

@tomdye tomdye force-pushed the select-helper-text branch from 5d5f21d to 9ab46f2 Compare April 9, 2019 09:37
@codecov
Copy link

codecov bot commented Apr 9, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@34fdb96). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #696   +/-   ##
=========================================
  Coverage          ?   98.98%           
=========================================
  Files             ?       45           
  Lines             ?     3337           
  Branches          ?      928           
=========================================
  Hits              ?     3303           
  Misses            ?       34           
  Partials          ?        0
Impacted Files Coverage Δ
src/select/index.ts 100% <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 34fdb96...9ab46f2. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 9, 2019

Codecov Report

Merging #696 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/select/index.ts 100% <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 34fdb96...f7a447e. Read the comment docs.

@@ -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 })
Copy link
Contributor

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?

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

thats a test @agubler

Copy link
Member

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 😂

@tomdye tomdye merged commit 8c3716d into dojo:master Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants