MatTooltip not working with MatAutocompleteList in Blazor

385 views Asked by At

When using the MatTooltip with MatAutocompleteList I get the following error:

Error: Microsoft.JSInterop.JSException: n.addEventListener is not a function TypeError: n.addEventListener is not a function

The MatTooltip works fine with all other components such as MatTextField, MatIconButton, etc. Only with the MatAutocompleteList I am not able to make it work.

I am using MatBlazor 2.7.0.

Here is some example code for reproduction purpose causing the error:

<MatBlazor.MatTooltip Tooltip="sadölkf">
     <MatBlazor.MatAutocompleteList @bind-Value="@currentValue" Items="@values" TItem="string" Label="Label:" RefBack="@context"></MatBlazor.MatAutocompleteList>
</MatBlazor.MatTooltip>

@code {
    private string currentValue;
    private string[] values = {
        "test1", "test2"
    };
}
1

There are 1 answers

0
prvn On

I had the same problem with MatChip i fixed it by adding RefBack="@context" in child

<MatTooltip Tooltip="This application has active work">
    <MatChip Class="mr-05" LeadingIcon="fast_forward" RefBack="@context"/>
</MatTooltip>