dotnet/aspnetcore

@onpointerenter and @onpointerleave not firing

Aperta

#34.288 aperta il 12 lug 2021

 (7 commenti) (2 reazioni) (0 assegnatari)C# (10.653 fork)batch import
Pillar: Technical Debtarea-blazorenhancementhelp wanted

Metriche repository

Star
 (37.933 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

This code isn't working with Blazor Wasm .Net 5.0, even though it is clearly supposed to be supported in this list: https://docs.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?view=aspnetcore-5.0#event-arguments

@page "/"

<h1>Event Testing</h1>

<p @onpointerenter="() => { pointerentered = true; }" @onpointerleave="() => { pointerentered = false; }" >Pointer Enter and Exit events!</p>
@if (pointerentered)
    {
        <p>Tooltip!</p>
    }


@code {
    bool pointerentered;
}

The text, "Tooltip!" should be appearing when the user cursor enters the paragraph, but it isn't. If you switch out the event with "onpointerover/out" or "onmouseover/out" it works.

Guida contributor