Skip to content

Commit

Permalink
added cursor: -webkit-grab.
Browse files Browse the repository at this point in the history
  • Loading branch information
shams-azam-wtg committed Jan 17, 2024
1 parent 70eda6c commit 4f97ed2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Blazor.Diagrams/Components/DiagramCanvas.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected override void OnInitialized()

_reference = DotNetObjectReference.Create(this);
BlazorDiagram.Changed += OnDiagramChanged;
Style = BlazorDiagram.Options.AllowPanning ? "cursor: grab;" : "cursor: default;";
Style = BlazorDiagram.Options.AllowPanning ? "cursor: grab; cursor: -webkit-grab;" : "cursor: default;";
}

protected override async Task OnAfterRenderAsync(bool firstRender)
Expand Down
3 changes: 1 addition & 2 deletions tests/Blazor.Diagrams.Tests/Components/DiagramCursorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ public void Behavior_WhenPanningOptionIsAllowed_CursorShouldBeGrab()
var cut = ctx.RenderComponent<DiagramCanvas>(parameters => parameters
.Add(n => n.BlazorDiagram, diagram));
var diagramCanvas = cut.Find(".diagram-canvas");
var canvasStyle = diagramCanvas.GetStyle().CssText;

// Assert
canvasStyle.Should().Contain("cursor: grab");
diagramCanvas.ToMarkup().Should().Contain("cursor: grab; cursor: -webkit-grab;");
}

[Fact]
Expand Down

0 comments on commit 4f97ed2

Please sign in to comment.