javascript-interop

How to do client-side UI events in Blazor

拜拜、爱过 提交于 2020-08-22 03:33:27
问题 I just started playing around with Blazor and I can already see the great potential of this new framework. I'm wondering, though, how it will handle doing simple things like setting focus on an input control? For instance, after I handle a click event, I want to set the focus to a text input control. Do I have to use JQuery for something like that, or will Blazor have some built-in methods for that sort of thing? Thanks Update: I posted an answer below with an example of how to set the focus

Port React app to Blazor app with JavaScript library imported using JavaScript interop

╄→гoц情女王★ 提交于 2020-01-16 09:01:13
问题 I currently have a React app that I'm trying to convert to a Blazor WebAssembly app. The React app has a component that imports a JavaScript library, the sample code for which can be seen here. The imported charting_library code itself isn't accessible without access being granted, but that shouldn't be an issue for answering this question. In my React app, as per the sample code, I have the following code (stripped for brevity): import { widget } from '../../charting_library/charting_library