-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(module:select): fix null value #1996
fix(module:select): fix null value #1996
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1996 +/- ##
==========================================
+ Coverage 25.38% 27.30% +1.91%
==========================================
Files 488 511 +23
Lines 32098 24482 -7616
Branches 0 233 +233
==========================================
- Hits 8148 6684 -1464
+ Misses 23950 17762 -6188
- Partials 0 36 +36
Continue to review full report at Codecov.
|
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.
Sorry to keep you waiting. I am a bit swamped.
I tested the changes using these reproductions of each of the issues:
#1783
<Select DataSource="@_list"
@bind-Value="@_selectedValue1"
ValueName="@nameof(Person.Id)"
LabelName="@nameof(Person.Name)"
Style="width:250px">
</Select>
@code {
record Person(string? Id, string Name);
string? _selectedValue1 = null;
List<Person> _list = new()
{
new Person(null, "John"),
new Person("2", "Lucy"),
new Person("3", "Jack"),
new Person("4", "Emily")
};
}
<Select @bind-Value="UserAssignedId"
TItemValue="string"
TItem="string"
DefaultActiveFirstOption="true"
Style="width:250px">
<SelectOptions>
<SelectOption TItemValue="string" TItem="string" Value="null" Label="Not assigned" />
<SelectOption TItemValue="string" TItem="string" Value="@("test")" Label="Test" />
</SelectOptions>
</Select>
@code {
string? UserAssignedId = null;
}
-
The Select component will throw exception if the value is null聽#1783 reproduction does not show label for the
null
value after init:
-
Changing back to
null
value does not show label. Thenull
value has to be selected once more for it to show in theSelect
input box:
@anddrzejb I think this is the issue tracked by #1587. Do you think we should also fix it here? |
Oh, you are correct, I forgot about that issue. It does seem to be directly connected with null value, that is why I thought it could be a part of this PR. |
@anranruye are you planning to fix the visual issues I mentioned above in this PR? If not, I will approve it. |
@anddrzejb Then let's close this one. I will fix that issue when I have time, in another pr. |
馃 This is a ...
馃敆 Related issue link
Fixes #1995
#1783
馃挕 Background and solution
馃摑 Changelog
鈽戯笍 Self Check before Merge