Preventing "first frame default value flash" of BindableElement

When I design a bindable UXML, it has some default values. But since each element has binding path, they would all be replaced by the bound object.

When I use it in my custom inspector, I load UXML, CloneTree(this), then finally .Bind(mySerializedObject). But the first frame I can see briefly the design-time value before it is controlled in the next frame.

What can I do after binding to force the tree to change immediately rather than waiting for the next frame? I tried MarkDirtyRepaint, but it is the same, the method says it will repaint the next frame which would occur anyways due to having new binding value. I want the tree to change this frame after setting .Bind.

Currently I manually change the tree using the binded value’s fields but it is not generic, different UXML needs different solution just to fix its first frame.

Hi, from what you’re describing this should not happen so this may be a bug but it’s hard to tell without proper investigation. Could you report a bug (Help → Report a Bug…) with a sample repro project?

1 Like