Skip to content

Blazor @ref not updating component #14715

@valincius

Description

@valincius

Describe the bug

When calling a referenced component's functions, the UI isn't being updated.

To Reproduce

  • Using latest ASP .NET Core

Steps to reproduce the behavior:

  1. Reference a component using @ref
  2. Call component member function which modifies the DOM

I made a fiddle that can be used to view this issue https://blazorfiddle.com/s/zkmpjypw
Clicking 'Show from component scope' button works just fine but clicking 'Show using ref' doesn't make the alert show.

If running in the debugger, you'll see that the component's function is called and the variables change but the DOM element is unchanged.

Expected behavior

DOM should reflect changes from @ref'd calls

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions