[Blazor] [JSInterop] How do you marshal ElementReference
from blazor into JS?
#55969
Unanswered
KieranDevvs
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Ive got a JS function that takes in an element. I want to call the function from Blazor with a element reference from my component.
The marshal source generator keeps saying there isnt a mapping for
ElementReference
, is there a way to do this or is it not supported? It would be strange if its not supported as I would have thought this would be an extremely common use case.I can give each component instance an
id
ofGuid.NewGuid()
and usedocument.getElementById
while marshaling the guid as a string but this isnt ideal.Component.razor.js:
Component.razor.cs:
Component.razor:
Beta Was this translation helpful? Give feedback.
All reactions