MatBlazor icon indicating copy to clipboard operation
MatBlazor copied to clipboard

Tooltip not working with AutocompleteList

Open Lucamuh opened this issue 4 years ago • 3 comments

When I use the MatTooltip with MatAutocompleteList, it is not working. I always get the following error:

Error: Microsoft.JSInterop.JSException: n.addEventListener is not a function
TypeError: n.addEventListener is not a function
    at new t (https://localhost:44367/_content/MatBlazor/dist/matBlazor.js:1:342466)
    at Object.e.init (https://localhost:44367/_content/MatBlazor/dist/matBlazor.js:1:342015)
    at https://localhost:44367/_framework/blazor.server.js:8:31421
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:44367/_framework/blazor.server.js:8:31390)
    at https://localhost:44367/_framework/blazor.server.js:1:19202
    at Array.forEach (<anonymous>)
    at e.invokeClientMethod (https://localhost:44367/_framework/blazor.server.js:1:19173)
    at e.processIncomingData (https://localhost:44367/_framework/blazor.server.js:1:17165)
    at e.connection.onreceive (https://localhost:44367/_framework/blazor.server.js:1:10276)
   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
   at MatBlazor.BaseMatComponent.JsInvokeAsync[T](String code, Object[] args)
   at MatBlazor.BaseMatTooltip.<.ctor>b__28_0()
   at MatBlazor.BaseMatComponent.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

I am using the latest version (MatBlazor 2.6.2.)

Lucamuh avatar Aug 13 '20 08:08 Lucamuh

I am also having the same problem with MatSelectItem.

quajak avatar Aug 13 '20 10:08 quajak

I got exactly the same error when using plain HTML too

christophe-mommer avatar Aug 28 '20 13:08 christophe-mommer

Have you set the RefBack="@context" in the Tooltips render fragment component? If yes i could imagine that MatSelectItem inside does not handle RefBack the right way. I came up to this because i had exactly the same problem but i found that i missed the RefBack assignment. After adding it worked.

fabianschurz avatar Jun 04 '21 21:06 fabianschurz