Skip to content

Commit

Permalink
[Lists] Pass Name parameter (#2305)
Browse files Browse the repository at this point in the history
* Clear IssueTester

* Pass Name parameter to name attribute in web components for SSR compat

* Add tests for Name parameter/attribute

* Add quotes, fix test , issue
  • Loading branch information
vnbaaij authored Jul 1, 2024
1 parent f50b09d commit a59d6a3
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 130 deletions.
45 changes: 0 additions & 45 deletions examples/Demo/Shared/Pages/Lab/IssueTester.razor
Original file line number Diff line number Diff line change
@@ -1,46 +1 @@
@page "/issue-tester"
@using System.ComponentModel.DataAnnotations

<FluentDataGrid Items="@employees.AsQueryable()" >
<PropertyColumn Property="@(e => e.Id)" />
<PropertyColumn Property="@(e => e.FullName)" />
<PropertyColumn Property="@(e => e.Subdivision)" />
<PropertyColumn Property="@(e => e.Position)" />
</FluentDataGrid>

@code {

public enum Positions
{
employee,
[Display(Name = "HR Manager (DA)")]
HrManager,
[Display(Name = "Project Manager (DA)")]
ProjectManager,
[Display(Name = "Administrator (DA)")]
Administrator
}

public class Employee
{
[Display(Name = "Id")]
public int Id { get; set; }
[Required, Display(Name = "Full Name")]
public string FullName { get; set; }
[Required, Display(Name = "Subdivision")]
public string Subdivision { get; set; }
[Required, Display(Name = "Position")]
public Positions Position { get; set; }

}

private List<Employee> employees = new List<Employee>
{
new Employee { Id = 1, FullName = "John Doe", Subdivision = "IT", Position = Positions.employee },
new Employee { Id = 2, FullName = "Jane Doe", Subdivision = "HR", Position = Positions.HrManager },
new Employee { Id = 3, FullName = "John Smith", Subdivision = "IT", Position = Positions.ProjectManager },
new Employee { Id = 4, FullName = "Jane Smith", Subdivision = "HR", Position = Positions.Administrator }
};


}
1 change: 1 addition & 0 deletions src/Core/Components/List/FluentCombobox.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
required="@Required"
@onchange="@ChangeHandlerAsync"
autofocus="@Autofocus"
name="@Name"
@attributes="AdditionalAttributes">
@_renderOptions
</fluent-combobox>
Expand Down
1 change: 1 addition & 0 deletions src/Core/Components/List/FluentListbox.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
size="@Size"
multiple="@Multiple"
required="@Required"
name="@Name"
selectedOptions="@(SelectedOptions != null && SelectedOptions.Any() ? string.Join(',', SelectedOptions.Select(i => GetOptionValue(i))) : null)"
@onchange="@ChangeHandlerAsync"
@onkeydown="@OnKeydownHandlerAsync"
Expand Down
1 change: 1 addition & 0 deletions src/Core/Components/List/FluentSelect.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
appearance="@Appearance.ToAttributeValue()"
current-value="@Value"
required="@Required"
name="@Name"
@onchange="@ChangeHandlerAsync"
@onkeydown="@OnKeydownHandlerAsync"
@attributes="AdditionalAttributes">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

<div class=" fluent-autocomplete-multiselect" style="width: 100%;" b-hg72r5b4ox="">
<fluent-text-field style="width: 100%; min-width: 100%;" placeholder="" id="xxx" value="" current-value="" name="xxx" appearance="outline" blazor:onchange="1" role="combobox" aria-expanded="false" aria-controls="" blazor:onclick="2" blazor:oninput="3" blazor:elementreference="xxx">
<svg slot="end" style="width: 16px; fill: var(--accent-fill-rest); cursor: pointer;" focusable="false" viewBox="0 0 16 16" aria-hidden="true" blazor:onkeydown="4" blazor:onclick="5" blazor:onfocus="6" tabindex="0" role="button">
<title>Search</title>
<path d="M9.1 10.17a4.5 4.5 0 1 1 1.06-1.06l3.62 3.61a.75.75 0 1 1-1.06 1.06l-3.61-3.61Zm.4-3.67a3 3 0 1 0-6 0 3 3 0 0 0 6 0Z"></path>
</svg>
</fluent-text-field>
</div>
Loading

0 comments on commit a59d6a3

Please sign in to comment.