question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SelectOption bug when Value = 0

See original GitHub issue

Hi team! I get a bug when using a select input and value of SelectOption = 0

    <Select @bind-Value="@_selectedValue2"
            Style="width: 120px;"
            TItemValue="int"
            TItem="string">
        <SelectOptions>
            <SelectOption TItemValue="int" TItem="string" Value=@(0) Label="zero" />
            <SelectOption TItemValue="int" TItem="string" Value=@(1) Label="one" />
            <SelectOption TItemValue="int" TItem="string" Value=@(2) Label="two" />
        </SelectOptions>
    </Select>

    @code {
      private int _selectedValue2 = 0;
    }

Further technical details

  • AntDesign Nuget Package version 0.8.1 ant-blazor-select-bug

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
anddrzejbcommented, Jun 1, 2021

@datnguyen89 Until now, another workaround is to do what @anranruye suggested but do not bind to a property in your model. Just attach OnSelectedItemChanged action and set your model’s property there.

1reaction
anranruyecommented, Jun 1, 2021

@datnguyen89 once we have decided what is the most expected behavior, we will fix this soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

why select option value if zero post empty
I am if select value="0" option and this post, it retuns the value with no problem. But, when I use value = 0...
Read more >
Ion-select doesn't show item with 0 value · Issue #16170
Bug Report Describe the Bug When a value is bound to a ion-select-option through the square brackets the option with value 0 is...
Read more >
Validation Error: Value is not valid - One Cause/Solution
Usually when we see this error it's because someone has written their selectOptions getter in a way that will not produce consistent results, ......
Read more >
AngularJS: API: select
When an item in the <select> menu is selected, the value of the selected option will be bound to the model identified by...
Read more >
How to Handle Dropdown in Playwright
With a playwright, you can handle different types of dropdowns. This article will focus on the basic one, including select and option tags....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found