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

feat(form-group): render label element if prop label-for set + horizontal layout optimizations #1423

Merged
merged 34 commits into from Dec 4, 2017

Conversation

Projects
None yet
2 participants
@tmorehouse
Member

tmorehouse commented Nov 30, 2017

This PR ads in the label-for prop, and if set, will render a <label> element instead of a <legend> element.

The value of label-for must be a valid input element ID that is contained within the <b-form-group>. No checks are performed to see if the input is actually within the <b-form-group>

fixes label-sr-only layout issues in horizontal mode

row/column markup only used in horizontal mode

feat(form-group): render label element instead of legend if prop labe…
…l-for set

This PR brings back the `label-for` prop, and if set, will render a `<label>` element instead of a `<legend>` element.

The value of `label-for` must be a valid input element ID that is contained within the `<b-form-group>`.  _No checks are performed to see if the input is actually within the `<b-form-group>`_
@codecov-io

This comment has been minimized.

codecov-io commented Nov 30, 2017

Codecov Report

Merging #1423 into dev will decrease coverage by 0.02%.
The diff coverage is 40%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1423      +/-   ##
==========================================
- Coverage   40.94%   40.92%   -0.03%     
==========================================
  Files         136      136              
  Lines        2789     2793       +4     
  Branches      868      869       +1     
==========================================
+ Hits         1142     1143       +1     
- Misses       1163     1165       +2     
- Partials      484      485       +1
Impacted Files Coverage Δ
src/components/form-group/_form-group.js 79.16% <40%> (-4.93%) ⬇️

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 dcffb5c...d11f6dc. Read the comment docs.

tmorehouse added some commits Nov 30, 2017

@tmorehouse tmorehouse requested a review from pi0 Nov 30, 2017

focus first input when legend clicked
Emulate `<label for="id">` behavior when `<legend>` element is rendered

tmorehouse added some commits Dec 1, 2017

tmorehouse added some commits Dec 3, 2017

Fix for sr-only label in horizontal layout, + force show feedback whe…
…n state set

The new force show prop negates the need for custom CSS

@tmorehouse tmorehouse changed the title from feat(form-group): render label element instead of legend if prop label-for set to [WIP] feat(form-group): render label element instead of legend if prop label-for set Dec 4, 2017

tmorehouse added some commits Dec 4, 2017

form-group optimisations
- remove form-row wrapper when not in horizontal layout mode
- optimize sr-only label layout
- associate legend to fieldset due to BS V4 invalid HTML structure
- allow label-cols to be passed as a string or number
- remove disabled prop as we are not always rendered as a fieldset

@tmorehouse tmorehouse changed the title from [WIP] feat(form-group): render label element instead of legend if prop label-for set to feat(form-group): render label element instead of legend if prop label-for set Dec 4, 2017

@tmorehouse tmorehouse removed the Status: WIP label Dec 4, 2017

@tmorehouse tmorehouse changed the title from feat(form-group): render label element instead of legend if prop label-for set to feat(form-group): render label element if prop label-for set + horizontal layout optimizations Dec 4, 2017

@tmorehouse tmorehouse merged commit ce164bf into dev Dec 4, 2017

1 of 2 checks passed

License Compliance FOSSA analyzing commit
Details
ci/circleci Your tests passed on CircleCI!
Details

@tmorehouse tmorehouse deleted the feat/form-group branch Dec 4, 2017

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