Category : blazor-webassembly

I’m migrating an existing website to Blazor WASM on .NET Core 5 and i’ve had some challenges initializing/calling this plugin from blazor. See HTML and JS code below: On my current website I initialize this plugin as follow: <script src="./hs-unfold.min.js"></script> <script> $(document).on(‘ready’, function () { // INITIALIZATION OF UNFOLD // ======================================================= var unfold = new ..

Read more

I have implemented the following code in wwwroot – index.html: "use strict"; (() => { const modified_inputs = new Set; const defaultValue = "defaultValue"; // store default values addEventListener("beforeinput", (evt) => { const target = evt.target; if (!(defaultValue in target || defaultValue in target.dataset)) { target.dataset[defaultValue] = ("" + (target.value || target.textContent)).trim(); } }); // ..

Read more

Blazor WASM Client Application requires to have certain hover events of menu items on a web browser screen and click events on tablet size screens. In order to receive the browser-screen width, js interop and an additional Browser service are used (similar to the approach in https://blazor.tips/blazor-how-to-ready-window-dimensions/) to get the width and apply conditions on ..

Read more

I’m using the drawio-integration project in my Blazor WebAssembly app. https://github.com/jgraph/drawio-integration The simple helloworld sample looks like this: <img onclick=’DiagramEditor.editElement(this);’ src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMjFweCIgaGVpZ2h0PSI2MXB4IiB2aWV3Qm94PSItMC41IC0wLjUgMTIxIDYxIiBjb250ZW50PSImbHQ7bXhmaWxlIGV0YWc9JnF1b3Q7VGdBR2JKbGNJaGw3a1JuRGFxSDQmcXVvdDsgYWdlbnQ9JnF1b3Q7TW96aWxsYS81LjAgKE1h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JvdW5kLWNvbG9yOiByZ2IoMjU1LCAyNTUsIDI1NSk7Ij48ZGVmcy8+PGc+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEyMCIgaGVpZ2h0PSI2MCIgZmlsbD0iI2ZmZmZmZiIgc3Ryb2tlPSIjMDAwMDAwIiBwb2ludGVyLWV2ZW50cz0iYWxsIi8+PGcgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9IkhlbHZldGljYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1zaXplPSIxMnB4Ij48dGV4dCB4PSI1OS41IiB5PSIzNC41Ij5TdGFydDwvdGV4dD48L2c+PC9nPjwvc3ZnPg==" style="cursor:pointer;"> http://jgraph.github.io/drawio-integration/helloworld.html https://github.com/jgraph/drawio-integration/blob/master/helloworld.html If I run the code like this everything works without a console error: <img onclick=’DiagramEditor.editElement(this);’ @ref=MyImageElementReference src="@DrawIoImageDataUrl" style="cursor:pointer;"> ElementReference MyImageElementReference; If I run the code like this everything works as well ..

Read more

I am building a simple login page using Blazor WebAssembly and utilizing JSInterop to write JS functions in order to work with Firebase/Firestore. I have a function that signs the user in through a simple custom form using Firebase methods, then grabs the id token and user id to then pass into another function that ..

Read more