-
Notifications
You must be signed in to change notification settings - Fork 75
docs(MultiSelect): add docs for custom values #2917
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
base: master
Are you sure you want to change the base?
Conversation
--- | ||
title: Custom Value | ||
page_title: MultiSelect - Custom Value | ||
description: Custom values and user input in the MultiColumnComboBox for Blazor. |
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.
MultiColumnComboBox? Is this correct?
|
||
# MultiSelect Custom Values | ||
|
||
The MultiSelect component allows the user to type in their own value that is not a part of the predefined set of options that the developer provided. |
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.
The MultiSelect component allows the user to type in their own value that is not a part of the predefined set of options that the developer provided. | |
The MultiSelect component lets users type their own values that are not part of the options predefined by the developer. |
|
||
The text entered by the user can still go into the field the combo box is bound to through two-way binding. | ||
|
||
To enable custom user input, set the `AllowCustom` parameter to `true`. When the user types a custom value, it will appear as the first item in the list with the label: `Use"typed value"`. Refer to the example below to see it in action. |
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.
To enable custom user input, set the `AllowCustom` parameter to `true`. When the user types a custom value, it will appear as the first item in the list with the label: `Use"typed value"`. Refer to the example below to see it in action. | |
To enable custom user input, set the `AllowCustom` parameter to `true`. When the user types a custom value, it appears as the first item in the list with the label: `Use"typed value"`. See the example below for details. |
|
||
To enable custom user input, set the `AllowCustom` parameter to `true`. When the user types a custom value, it will appear as the first item in the list with the label: `Use"typed value"`. Refer to the example below to see it in action. | ||
|
||
> When MultiSelect is bound to a model, the `TextField`, `ValueField` and the `Value` must be of type `string`. Otherwise an exception will be thrown. Strings are required because the user input can take any form and may not be parsable to other types (such as numbers or GUID). |
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.
> When MultiSelect is bound to a model, the `TextField`, `ValueField` and the `Value` must be of type `string`. Otherwise an exception will be thrown. Strings are required because the user input can take any form and may not be parsable to other types (such as numbers or GUID). | |
> When the MultiSelect is bound to a model, the `TextField`, `ValueField`, and `Value` must be of type `string`. Otherwise, an exception is thrown. Strings are required because user input can take any form and may not be parsable to other types (such as numbers or GUIDs). |
|
||
> When MultiSelect is bound to a model, the `TextField`, `ValueField` and the `Value` must be of type `string`. Otherwise an exception will be thrown. Strings are required because the user input can take any form and may not be parsable to other types (such as numbers or GUID). | ||
|
||
When custom input is allowed, the [ValueChanged event](slug:multiselect-events#valuechanged) fires on every keystroke, and not when an item is selected, because the MultiSelect component acts as a text input. |
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.
When custom input is allowed, the [ValueChanged event](slug:multiselect-events#valuechanged) fires on every keystroke, and not when an item is selected, because the MultiSelect component acts as a text input. | |
When custom input is allowed, the [`ValueChanged` event](slug://multiselect-events#valuechanged) fires on every keystroke instead of when an item is selected. This happens because the MultiSelect component behaves like a text input. |
|
||
## Limitations | ||
|
||
* `AllowCustom` is not compatible with [Adaptive rendering](slug:adaptive-rendering). |
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.
* `AllowCustom` is not compatible with [Adaptive rendering](slug:adaptive-rendering). | |
* `AllowCustom` is not compatible with [adaptive rendering](slug://adaptive-rendering). |
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.
What does this mean exactly? That MultiSelect with AllowCustom is not adaptive (is it adaptive when used with predefined values only)? Or something else?
@bind-Value="@SelectedCities" | ||
TextField="@nameof(City.CityName)" ValueField="@nameof(City.CityName)" | ||
AllowCustom="true" | ||
Placeholder="Select city for the list or type a custom one" |
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.
Placeholder="Select city for the list or type a custom one" | |
Placeholder="Select a city for the list or type a custom one" |
|
||
The MultiSelect component allows the user to type in their own value that is not a part of the predefined set of options that the developer provided. | ||
|
||
The text entered by the user can still go into the field the combo box is bound to through two-way binding. |
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.
Is combo box correct here? (Just checking if it's a leftover from MultiColumnComboBox.)
closes: https://github.com/telerik/blazor/issues/8693