Comments (4)
That is indeed not possible right now. But it would be fairly easy to add this capability.
from bolero.
Thanks Tamil,
I just needed to focus an element so did that by tagging the id and using jsinterop to find the item by id and focus. However I probably could return the reference from the javascript if I needed more.
For anyone else's benefit who needs to do something similar:
In my index.js
window.utilFuncs =
{
focusElementByID: function (id) {
const myElement = document.getElementById(id)
myElement.focus();
}
}
I called that then with
let focusJobIDSelection (jobID: int64) =
let checkBoxID jobID = $"SelectionCheck%d{jobID}"
task {
let elementID = checkBoxID jobID
return!
(jSRuntime.InvokeVoidAsync("utilFuncs.focusElementByID", elementID))
.AsTask()
}
|> Async.AwaitTask
from bolero.
I just use
let focusElement (id:string) = this.JSRuntime.InvokeVoidAsync("focusElement", id) |> ignore
.
Why should I wait for it to complete?
from bolero.
This is fixed in version 0.22. An attribute ref="${MyRef}"
will give you a method .MyRef()
that takes an HtmlRef
as argument. https://fsbolero.io/blog/20230410-bolero-0-22-released
from bolero.
Related Issues (20)
- After Upgrading to to 0.23: WebAssembly error - Unhandled exception rendering component: Cannot read properties of null (reading 'insertBefore') HOT 15
- Upgrading to .net 8.0 client wasm hosted project, compiler errors: failing 'open Bolero.Html' HOT 6
- HTML templates autocomplete
- Update v0.23 dependencies to .NET 8 RTM HOT 1
- Scoped CSS not working with HTML templates HOT 2
- [Hot reload] of HTML pages does not work if you start client only HOT 1
- Trigger CSS recompilation for C# razor project HOT 3
- [CSS isolation] attributes do not apply to components generated in code HOT 3
- Custom Bolero node HOT 3
- Add Server-project retroactively? HOT 1
- [`OnParametersSet`] happens after `OnInitalized` if navigation happens through `NavigationManager` HOT 2
- Blazor interactive render modes compatibility HOT 5
- Preserve focus between fields change
- Web worker with F# HOT 3
- Hot reload causing template to drop class attribute HOT 1
- Bolero ignores ASPNETCORE_HTTP_PORTS environment variable HOT 3
- Slow rendering HOT 2
- Is Bolero capable of integrating with MAUI thru BlazorWebView?
- CSS isolation does not work HOT 3
- Seeing Endpoint compilation error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bolero.