Comments (7)
With the autocomplete, we control the rendering of the 'list'. That is why we can do the virtualization. For the combobox the list comes from the web component. We can't get in that render process. @dvoituron correct?
from fluentui-blazor.
Yes. Exactly.
If you have a large list of items, ˋFluentAutocompleteˋ would be better.
from fluentui-blazor.
Hey @vnbaaij & @dvoituron thanks for your input on this topic! :)
My problem with the FluentAutocomplete
component is the extra amount of work which is required in order to get a 1:1 realtionship. Although the component exposes @bind-SelectedOption
this option is not supported. In order to get it working for just 1 item all of this is necessary:
- Set
MaximumSelectedOptions="1"
- Define an IEnenumerable as a property
- Bind
@bind-SelectedOptions
to an IEnumerable - Bind
@bind-SelectedOptions:after
and do manual mapping - On pageload the TOption from your actual model needs be assigned to your IEnumerable of step 2.
Or when we talk in code:
@code {
private IEnumerable<Country> CountryAutocomplete { get; set; } = [];
// Assume MyInput contains Country and CountryId
public MyInput? Input { get; set; }
protected override async Task OnInitializedAsync()
{
Input = await GetInputAsync();
if (Input is not null)
{
if(Input.Country is not null)
{
CountryAutocomplete = [Input.Country];
}
}
}
private void OnCountryChanged()
{
if (Input is null)
{
return;
}
var _country = KostenstelleAutocomplete.FirstOrDefault();
Input.Country = _country;
Input.CountryId = _country?.CountryId;
}
}
It would be great if this process would be as easy as with the FluentCombobox
where I only need to bind to the actual property of my object.
from fluentui-blazor.
Also aren't the options rendered here?
from fluentui-blazor.
It's not about the rendering of the options, it is about the list the options are rendered in.
from fluentui-blazor.
You can find an example of using Autocomplete with 1 item on this page, section "Culture"
https://www.fluentui-blazor.net/DateTime
from fluentui-blazor.
@dvoituron yes as you can see it's quite hard to do. Now throw a new object instance from the database into the pot as well and it will drive you crazy! :)
from fluentui-blazor.
Related Issues (20)
- fix: Disabled option does not get showed as selected value when @bind-Value is equal disabled one [FluentSelect] HOT 11
- TreeView: Is it possible to have clicking anywhere on the row expand the item? HOT 1
- fix: Skeleton Component in Light Theme HOT 1
- fix: Duplicates IDs if Overflow in [Overflow] HOT 1
- fix: body background color variable HOT 5
- feat: add the ability to lock (frozen) column when scrolling horizontally in DataGrid HOT 1
- fix: FluentSelect fails in SSR forms HOT 8
- Column Headers on FluentGrid Control Do Not Render Properly with Horizontal Scroll HOT 1
- fix: tooltip anchor diamond moves to the center of the tooltip text box in blazor when using default tooltip position HOT 4
- feat: add Color to/in FluentPersona HOT 4
- Column Headers and Rows on FluentGrid Control Lose Style with Horizontal Scroll HOT 4
- The EventCallbacks of the FluentNavGroup not working. HOT 1
- fix: FluentPersona component source code is in the List/ folder HOT 4
- fix: `FluentProfileMenu`'s inner `FluentPersona` component does not show initials HOT 2
- fix: (Regression) ExpandedChanged binding in FluentNavGroup no longer firing HOT 7
- fix: Tooltip without service not work HOT 5
- fix: FluentE Group doesn't work the first menu element. HOT 1
- Populate DisplayAttribute for DataGrid content HOT 7
- fix: clear selection in FluentCombobox HOT 3
- fix: Modifying the SelectedOptions in FluentSelect 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.