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

fix(select): allow select to work with empty values in nb-option #1282

Merged
merged 15 commits into from
Apr 18, 2019

Conversation

aefox
Copy link
Contributor

@aefox aefox commented Mar 7, 2019

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

This PR fixes #1235 and in order to allow nb-options have values of "" or "0".

These changes also end up fixes #1260.

BREAKING CHANGE:

Only 'null' and 'undefined' option values now considered as reset. false and falsy values such as 0, '', NaN don't reset select value anymore.

@aefox aefox mentioned this pull request Mar 7, 2019
2 tasks
Copy link
Contributor

@yggg yggg left a comment

Choose a reason for hiding this comment

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

@aefox Thanks a lot for contribution

src/framework/theme/components/select/select.component.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@yggg yggg left a comment

Choose a reason for hiding this comment

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

Just noticed one more thing. An option doesn't render checkbox if it's value is falsy. (sources)
I think we should use this.value != null here as well to show checkbox for falsy values. And it would be great to add the test which would check this.

Fixed in 53189a7

@yggg yggg added this to the 4.0.0 milestone Mar 28, 2019
@yggg yggg added this to In progress in Nebular via automation Apr 11, 2019
@yggg yggg moved this from In progress to Blocked in Nebular Apr 12, 2019
@yggg yggg requested a review from nnixaa April 15, 2019 06:11
@yggg yggg changed the base branch from master to next April 18, 2019 11:26
@codecov
Copy link

codecov bot commented Apr 18, 2019

Codecov Report

Merging #1282 into next will increase coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##             next    #1282      +/-   ##
==========================================
+ Coverage   82.54%   82.56%   +0.02%     
==========================================
  Files         237      237              
  Lines        7274     7274              
  Branches      635      635              
==========================================
+ Hits         6004     6006       +2     
  Misses       1080     1080              
+ Partials      190      188       -2
Impacted Files Coverage Δ
...mework/theme/components/select/select.component.ts 91.25% <100%> (+1.09%) ⬆️
...mework/theme/components/select/option.component.ts 97.61% <100%> (ø) ⬆️

Nebular automation moved this from Blocked to Reviewer approved Apr 18, 2019
@yggg yggg merged commit adc4629 into akveo:next Apr 18, 2019
Nebular automation moved this from Reviewer approved to Done Apr 18, 2019
yggg pushed a commit that referenced this pull request May 27, 2019
BREAKING CHANGE:

Only 'null' and 'undefined' option values now considered as reset. false and falsy values such as 0, '', NaN don't reset select value anymore.
yggg pushed a commit that referenced this pull request Jun 5, 2019
BREAKING CHANGE:

Only 'null' and 'undefined' option values now considered as reset.
false and falsy values such as 0, '', NaN don't reset select value anymore.
yggg pushed a commit that referenced this pull request Jun 6, 2019
BREAKING CHANGE:

Only `null` and `undefined` option values now considered as reset.
`false` and falsy values such as `0`, `''`, `NaN` don't reset select
value anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Nebular
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants