This can be the case if v.Value <- "foo" is called before the element is actually rendered. Will look into this.

By on 12/14/2015 1:46 AM ()

Thanks. It'd be great if an example was added into UI.Next smaples repository

By on 12/14/2015 2:09 AM ()

This is a bug in UI.Next. I have just committed a fix and it will be included in the next release. Until then you could do something like this:

1
2
3
4
5
6
7
8
9
10
11
let elems = ["bar"; "foo"]
let v = Var.Create "bar"
let doc = 
    Doc.Select [
        on.afterRender (fun el ->
            let idx = List.findIndex ((=) v.Value) elems
            el?selectedIndex <- idx)
        attr.``class`` "form-control"
    ] id elems v

v.Value <- "foo"
By on 12/14/2015 2:35 AM ()

Thanks, it works. BTW, when are you planning to make next release?

By on 12/15/2015 12:24 AM ()

It is now released.

By on 12/18/2015 2:20 AM ()

Updated, checked. Works OK :)

By on 12/18/2015 10:08 AM ()

According to sources it should work, but it does not.

By on 12/10/2015 2:33 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper