Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
erinnmclaughlin committed May 18, 2024
1 parent 9cdb36b commit cb7ba04
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<HBDropdownItemButton class="dropdown-item" disabled="true">Disabled Button</HBDropdownItemButton>
<HBDropdownItemButton class="dropdown-item" @onclick:stopPropagation="true">Button (Stop Propagation)</HBDropdownItemButton>
<HBDropdownItemLink class="dropdown-item">Link</HBDropdownItemLink>
<HBDropdownItemLink class="dropdown-item" @onclick:preventDefault="true">Link (Prevent Default)</HBDropdownItemLink>
<HBDropdownItemLink class="dropdown-item" @onclick:stopPropagation="true">Link (Stop Propagation)</HBDropdownItemLink>
<HBDropdownItemLink class="dropdown-item" OnClickPreventDefault="true" OnClickStopPropagation="true">Link (Prevent Default and Stop Propagation)</HBDropdownItemLink>
<HBDropdownItemLink class="dropdown-item" href="#" @onclick:preventDefault="true">Link (Prevent Default)</HBDropdownItemLink>
<HBDropdownItemLink class="dropdown-item" href="#" @onclick:stopPropagation="true">Link (Stop Propagation)</HBDropdownItemLink>
<HBDropdownItemLink class="dropdown-item" href="#" OnClickPreventDefault="true" OnClickStopPropagation="true">Link (Prevent Default and Stop Propagation)</HBDropdownItemLink>
</HBDropdownItems>
</HBDropdown>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
private IJSRuntime JS { get; set; } = default!;

[Parameter]
public IReferenceable Referenceable { get; set; } = default!;
public IReferenceable Container { get; set; } = default!;

[Parameter]
public EventCallback OnClick { get; set; }
Expand Down Expand Up @@ -40,7 +40,7 @@
if (firstRender)
{
var module = await JS.InvokeAsync<IJSObjectReference>("import", "./_content/HeadlessBlazor.Core/Behaviors/HBOutsideClickBehavior.razor.js");
jsObjRef = await module.InvokeAsync<IJSObjectReference>("OutsideClickBehavior.createInstance", Referenceable.ElementReference, objRef);
jsObjRef = await module.InvokeAsync<IJSObjectReference>("OutsideClickBehavior.createInstance", Container.ElementReference, objRef);
await module.DisposeAsync();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/HeadlessBlazor.Dropdown/HBDropdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
{
b.OpenComponent<HBOutsideClickBehavior>(seq++);
b.AddAttribute(seq++, nameof(HBOutsideClickBehavior.OnClick), new EventCallback(this, CloseAsync));
b.AddAttribute(seq++, nameof(HBOutsideClickBehavior.Referenceable), this);
b.AddAttribute(seq++, nameof(HBOutsideClickBehavior.Container), this);
b.CloseComponent();
}

Expand Down

0 comments on commit cb7ba04

Please sign in to comment.