Skip to content

Commit

Permalink
šŸ› fix(Menu): NullReferenceException (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem authored Apr 23, 2023
1 parent e857d47 commit 8e4d3d6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Component/BlazorComponent.Web/src/interop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ export function getMenuableDimensions(hasActivator, activatorSelector, isDefault

var dimensions = {
activator: {} as any,
content: null,
content: {},
relativeYOffset: 0,
offsetParentLeft: 0
};
Expand Down Expand Up @@ -1089,7 +1089,7 @@ export function getMenuableDimensions(hasActivator, activatorSelector, isDefault
}

function measure(el: HTMLElement, isDefaultAttach) {
if (!el) return null
if (!el) return {}

const rect = getRoundedBoundedClientRect(el)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{
public class MenuableDimensions
{
public MenuablePosition Activator { get; set; } = new MenuablePosition();
public MenuablePosition Content { get; set; } = new MenuablePosition();
public MenuablePosition Activator { get; set; } = new();
public MenuablePosition Content { get; set; } = new();
public double RelativeYOffset { get; set; }
public double OffsetParentLeft { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{
public class MultipleResult
{
public WindowAndDocument WindowAndDocument { get; set; }
public WindowAndDocument WindowAndDocument { get; set; } = new();

public MenuableDimensions Dimensions { get; set; }
public MenuableDimensions Dimensions { get; set; } = new();

public int ZIndex { get; set; }
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 8e4d3d6

Please sign in to comment.