Comments (2)
It can be that this behavior has changed between previous version and v4.8. We overhauled the list components to inherit from FluentinputBase
What has not changed is how this situation should be implemented. When you want to bind to the Value, you should use the OptionValue to determine if an item is selected. When you bind to SelectedOption, you should use the OptionSelected to determine if an option is selected. See https://www.fluentui-blazor.net/Select#default for the 'value variant'. See below for the 'SelectedOption variant'
<FluentSelect Label="Language:"
Items="@languages"
OptionText="@(i => i.Text)"
OptionValue="@(i => i.Value)"
OptionSelected="@(i => i.Selected)"
@bind-SelectedOption="@language" TOption="Option<string>" />
<p>Selected language: @language?.Text</p>
@code {
private Option<string?> language;
private static List<Option<string>> languages = new()
{
{ new Option<string> { Value = "DE", Text = "German" } },
{ new Option<string> { Value = "EN", Text = "English", Selected = true }},
};
}
Your code was using a mix of both options
from fluentui-blazor.
Thank you for clarification, it works after modification.
from fluentui-blazor.
Related Issues (20)
- fix: anchored HorizontalPosition in FluentMenu does not always work inside a splitter panel HOT 4
- Larger close button in fluent dialog header template HOT 1
- fix:[a11y sev2] OnRowClick is not triggered on keyboard enter in DataGrid
- fix: Dialog.Hide() doesn't hide in DialogService/FluentDialog HOT 5
- Change FluentButton background HOT 1
- fix: Setting a design token resets the FluentDesignTheme color
- feat: add @ref to form inputs HOT 5
- feat: Support read-only collections as items in `<FluentDataGrid>` with `ItemsProvider` HOT 1
- RawEventHandlers fluent-menu-item has error HOT 6
- FluentDatePicker triggers onfocusout event before bind-value update HOT 1
- fix: FluentTextEdit does not update bound value prior to Form onValidSubmit. HOT 2
- fix: Cannot set `ValueChanged` without binding in `FluentNumberField` HOT 2
- fix: Cannot set properties of null (setting '_blazorInputFileNextFileId') when FluentInputFile is used in EditForm HOT 3
- fix: In a wasm application, when installed on an iOS Fluent Tabs does not show overflow badge and throw an exception HOT 1
- fix: ButtonClick toggel FluentAccordionItem in HeadingTemplate HOT 1
- feat: add Format or Suffix to the FluentNumberField HOT 4
- fix: Value binding not working in FluentSlider HOT 2
- FR: Improve FluentTimePicker 🕒 HOT 1
- fix: FluentSelect doesn't render properly when changing both Value and Items HOT 3
- fix: Autofocus does not work reliable for TextFields in dialogs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentui-blazor.