Skip to content

Blazor: add support for toggle event #20859

@LeonarddeR

Description

@LeonarddeR

Is your feature request related to a problem? Please describe.

With Blazor, I'm trying to use the Ontoggle event of a html5 details element to render its content as soon as the element is toggled. However, when adding @ontoggle to the details element, the component fails to render.

Describe the solution you'd like

Support the ontoggle element along with a dedicated EventArgs class that conveys the state of the element

Additional context

I'm getting the following traceback in the Firefox web console:

[2020-04-15T14:30:16.586Z] Error: System.AggregateException: One or more errors occurred. (InvalidCharacterError: String contains an invalid character)

 ---> System.InvalidOperationException: InvalidCharacterError: String contains an invalid character

   at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)

   --- End of inner exception stack trace --- blazor.server.js:15:27309
    log https://localhost:44378/_framework/blazor.server.js:15
    C https://localhost:44378/_framework/blazor.server.js:8
    S https://localhost:44378/_framework/blazor.server.js:8
    invokeClientMethod https://localhost:44378/_framework/blazor.server.js:1
    invokeClientMethod https://localhost:44378/_framework/blazor.server.js:1
    processIncomingData https://localhost:44378/_framework/blazor.server.js:1
    onreceive https://localhost:44378/_framework/blazor.server.js:1
    onmessage https://localhost:44378/_framework/blazor.server.js:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onehelp wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions