Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

fix(Input): Display floating input label if value is not undefined #50

Merged
merged 5 commits into from
Aug 1, 2019

Conversation

cehsu
Copy link
Contributor

@cehsu cehsu commented Jul 31, 2019

This change ensures that floating labels appear for zero values.

Summary

Bug:

  1. Blur out of an input with a floating label, and a value of 0 (can be tested via value={0}).
  2. We expect the label to remain, but it doesn't:
    Screen Shot 2019-07-31 at 1 45 31 PM

Cause:

  1. Zero values were not being accounted for in checking whether to display floating labels. Checking for zero values allows the label to be displayed:
    Screen Shot 2019-07-31 at 1 58 38 PM

@cehsu cehsu requested a review from a team July 31, 2019 21:11
@ghost ghost requested review from erikshestopal and schlegz July 31, 2019 21:11
src/Form/Input.js Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #50 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #50   +/-   ##
======================================
  Coverage    68.5%   68.5%           
======================================
  Files          22      22           
  Lines         435     435           
  Branches       92      92           
======================================
  Hits          298     298           
  Misses        107     107           
  Partials       30      30
Impacted Files Coverage Δ
src/Form/Label.js 33.33% <ø> (ø) ⬆️
src/Form/Input.js 46.55% <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 a55b4a9...8376158. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #50 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #50   +/-   ##
======================================
  Coverage    68.5%   68.5%           
======================================
  Files          22      22           
  Lines         435     435           
  Branches       92      92           
======================================
  Hits          298     298           
  Misses        107     107           
  Partials       30      30
Impacted Files Coverage Δ
src/Form/Label.js 33.33% <ø> (ø) ⬆️
src/Form/Input.js 46.55% <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 a55b4a9...e46a982. Read the comment docs.

src/Form/Input.js Outdated Show resolved Hide resolved
@cehsu cehsu requested a review from a team August 1, 2019 18:40
@ghost ghost requested review from kylealwyn and schlegz August 1, 2019 18:40
@cehsu cehsu merged commit 259cd6f into master Aug 1, 2019
@cehsu cehsu deleted the fix/input-floating-label branch August 1, 2019 19:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants