diff --git a/src/BootstrapBlazor.Server/Components/Samples/Selects.razor b/src/BootstrapBlazor.Server/Components/Samples/Selects.razor index 4b5b6c51e44..16f1809e5d1 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Selects.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Selects.razor @@ -316,21 +316,27 @@ Introduction="@Localizer["SelectsShowSearchIntro"]" Name="ShowSearch">
-
+
+
+ + + + +
-
+
-
-
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Selects.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Selects.razor.cs index 11332afc37b..883a8afe457 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Selects.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/Selects.razor.cs @@ -47,6 +47,8 @@ public sealed partial class Selects private bool _isShowSearchClearable; + private bool _isFixedSearch; + private bool _isClearable; private string? _fooName; @@ -357,6 +359,14 @@ private AttributeItem[] GetAttributes() => DefaultValue = "false" }, new() + { + Name = "IsFixedSearch", + Description = Localizer["SelectsIsFixedSearch"], + Type = "boolean", + ValueList = "true / false", + DefaultValue = "false" + }, + new() { Name = "IsDisabled", Description = Localizer["SelectsIsDisabled"], diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 3636abe6d2b..94e5b78975b 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -3154,7 +3154,7 @@ "SelectsCustomTemplateTitle": "Custom option templates", "SelectsCustomTemplateIntro": "By setting the ItemTemplate you can customize the option rendering style", "SelectsShowSearchTitle": "Drop-down box with search box", - "SelectsShowSearchIntro": "Controls whether the search box is displayed by setting the ShowSearch property, which is not displayed by default false", + "SelectsShowSearchIntro": "Controls whether the search box is displayed by setting the ShowSearch property, which is not displayed by default false. Fixed the search bar by setting IsFixedSearch", "SelectsConfirmSelectTitle": "Drop-down box with confirmation", "SelectsConfirmSelectIntro": "Block changes to the current value by setting the OnBeforeSelectedItemChange delegate.", "SelectsTimeZoneTitle": "Timezone", @@ -3194,7 +3194,8 @@ "SelectsGenericDesc": "

Please refer to Design Ideas to understand this feature. In this example, by selecting the drop-down box option, the value obtained is the Foo instance, and the value displayed in the text box on the right is the Address value of the Foo attribute

In this example, the ValueEqualityComparer and CustomKeyAttribute parameters are not set, and the [Key] tag of the Id attribute of Foo is used for equality judgment

", "SelectsOnInputChangedCallback": "Callback method for converting input text into corresponding Value in edit mode", "TextConvertToValueCallback": "Callback method when input text changes in edit mode", - "SelectsIsEditable": "Whether editable" + "SelectsIsEditable": "Whether editable", + "SelectsIsFixedSearch": "Whether fixed the search box" }, "BootstrapBlazor.Server.Components.Samples.Sliders": { "SlidersTitle": "Slider", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index d1f1067eeca..9fe32229fa2 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -3154,7 +3154,7 @@ "SelectsCustomTemplateTitle": "自定义选项模板", "SelectsCustomTemplateIntro": "通过设置 ItemTemplate 可以自定义选项渲染样式", "SelectsShowSearchTitle": "带搜索框的下拉框", - "SelectsShowSearchIntro": "通过设置 ShowSearch 属性控制是否显示搜索框,默认为 false 不显示搜索框", + "SelectsShowSearchIntro": "通过设置 ShowSearch 属性控制是否显示搜索框,默认为 false 不显示搜索框;通过设置 IsFixedSearch 固定搜索栏", "SelectsConfirmSelectTitle": "带确认的下拉框", "SelectsConfirmSelectIntro": "通过设置 OnBeforeSelectedItemChange 委托,阻止当前值的改变", "SelectsTimeZoneTitle": "时区下拉框", @@ -3194,7 +3194,8 @@ "SelectsGenericDesc": "

请参考 设计思路 理解此功能。本例中通过选择下拉框选项,得到的值为 Foo 实例,右侧文本框内显示值为 Foo 属性 Address

本例中未设置 ValueEqualityComparer 以及 CustomKeyAttribute 参数,使用 Foo 属性 Id[Key] 标签进行相等判定

", "SelectsOnInputChangedCallback": "编辑模式下输入文本转换为对应 Value 回调方法", "TextConvertToValueCallback": "编辑模式下输入文本变化时回调方法", - "SelectsIsEditable": "是否可编辑" + "SelectsIsEditable": "是否可编辑", + "SelectsIsFixedSearch": "是否固定搜索栏" }, "BootstrapBlazor.Server.Components.Samples.Sliders": { "SlidersTitle": "Slider 滑块", diff --git a/src/BootstrapBlazor/Components/Select/Select.razor b/src/BootstrapBlazor/Components/Select/Select.razor index b9adcebc2f7..f41bc4f7ff9 100644 --- a/src/BootstrapBlazor/Components/Select/Select.razor +++ b/src/BootstrapBlazor/Components/Select/Select.razor @@ -30,12 +30,15 @@ { } -