Allow HTML attributes on SearchBar.
This commit is contained in:
parent
ea9213f9c1
commit
23d20f2f04
@ -1,4 +1,4 @@
|
|||||||
<div class="input-group mb-3 input-width">
|
<div class="input-group mb-3 input-width" @attributes="OtherAttributes">
|
||||||
<input type="text" class="form-control" placeholder="Search servers"
|
<input type="text" class="form-control" placeholder="Search servers"
|
||||||
@bind-value="serverFilter"
|
@bind-value="serverFilter"
|
||||||
@bind-value:event="oninput" />
|
@bind-value:event="oninput" />
|
||||||
@ -18,6 +18,10 @@
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<string> FilterSearchTerm { get; set; }
|
public EventCallback<string> FilterSearchTerm { get; set; }
|
||||||
|
|
||||||
|
[Parameter(CaptureUnmatchedValues = true)]
|
||||||
|
// Enables other HTML attributes like class, style, data-x, etc.
|
||||||
|
public Dictionary<string, object>? OtherAttributes { get; set; }
|
||||||
|
|
||||||
private void HandleSearch()
|
private void HandleSearch()
|
||||||
{
|
{
|
||||||
FilterSearchTerm.InvokeAsync(serverFilter);
|
FilterSearchTerm.InvokeAsync(serverFilter);
|
||||||
|
|||||||
@ -6,7 +6,11 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<CityListComponent @ref="cityListComponent" SelectCityCallBack="HandleCitySelection"></CityListComponent>
|
<CityListComponent @ref="cityListComponent" SelectCityCallBack="HandleCitySelection"></CityListComponent>
|
||||||
<br/>
|
<br/>
|
||||||
<SearchBarComponent @ref="searchBarComponent" FilterSearchTerm="HandleSearch"></SearchBarComponent>
|
<SearchBarComponent
|
||||||
|
@ref="searchBarComponent"
|
||||||
|
FilterSearchTerm="HandleSearch"
|
||||||
|
style="width: 600px">
|
||||||
|
</SearchBarComponent>
|
||||||
<br/>
|
<br/>
|
||||||
<a href="@($"/servers/add")" class="btn btn-primary">Add</a>
|
<a href="@($"/servers/add")" class="btn btn-primary">Add</a>
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user