Skip to content
Prev Previous commit
Next Next commit
[Menu] fixed typos and changed properties to fields in sample
  • Loading branch information
rpodevns committed Feb 21, 2025
commit 5e87d6526f6a06732fde7403e375084ca5b5871d
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@
private bool checkbox1 = false;
private bool checkbox2 = false;

private bool radio1 { get; set; } = false;
private bool radio2 { get; set; } = false;
private bool radio3 { get; set; } = false;
private bool radio4 { get; set; } = false;
private bool radio5 { get; set; } = false;
private bool radio6 { get; set; } = false;
private bool radio7 { get; set; } = false;
private bool radio8 { get; set; } = false;
private bool radio1 = false;
private bool radio2 = false;
private bool radio3 = false;
private bool radio4 = false;
private bool radio5 = false;
private bool radio6 = false;
private bool radio7 = false;
private bool radio8 = false;

private void ToggleCheckboxItem2()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/Demo/Shared/Pages/Menu/MenuPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

<DemoSection Title="With radio buttons and checkboxes" Component="@typeof(MenuCheckRadio)"></DemoSection>

<DemoSection Title="Detect when checked and unchecked" Component="@typeof(MenuCheckChanged)">
<DemoSection Title="Detect when checked and unchecked (2-way binding)" Component="@typeof(MenuCheckChanged)">
<Description>
<p>
The <code>CheckedChanged</code> EventCallback is invoked when the <code>FluentMenuItem</code> Role is <code>MenuItemCheckbox</code> or <code>MenuItemRadio</code>.
Expand Down
6 changes: 4 additions & 2 deletions src/Core/Components/Menu/FluentMenu.razor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Add Left click event to open the PowerMenu
// Add Left click event to open the FluentMenu
export function addEventLeftClick(id, dotNetHelper) {
var item = document.getElementById(id);
if (!!item) {
Expand All @@ -8,7 +8,7 @@ export function addEventLeftClick(id, dotNetHelper) {
}
}

// Add Right click event to open the PowerMenu
// Add Right click event to open the FluentMenu
export function addEventRightClick(id, dotNetHelper) {
var item = document.getElementById(id);
if (!!item) {
Expand All @@ -20,6 +20,8 @@ export function addEventRightClick(id, dotNetHelper) {
}
}

// Must use an animation frame to ensure the DOM is fully updated before checking the element's
// attributes to prevent stale or inconsistent reads.
export function isChecked(menuItemId) {
return new Promise(resolve => {
requestAnimationFrame(() => {
Expand Down