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"
|
||||
@bind-value="serverFilter"
|
||||
@bind-value:event="oninput" />
|
||||
@ -18,6 +18,10 @@
|
||||
[Parameter]
|
||||
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()
|
||||
{
|
||||
FilterSearchTerm.InvokeAsync(serverFilter);
|
||||
|
||||
@ -6,7 +6,11 @@
|
||||
<br/>
|
||||
<CityListComponent @ref="cityListComponent" SelectCityCallBack="HandleCitySelection"></CityListComponent>
|
||||
<br/>
|
||||
<SearchBarComponent @ref="searchBarComponent" FilterSearchTerm="HandleSearch"></SearchBarComponent>
|
||||
<SearchBarComponent
|
||||
@ref="searchBarComponent"
|
||||
FilterSearchTerm="HandleSearch"
|
||||
style="width: 600px">
|
||||
</SearchBarComponent>
|
||||
<br/>
|
||||
<a href="@($"/servers/add")" class="btn btn-primary">Add</a>
|
||||
<br/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user