From 7e7ca88c3d00bf6dc8d6bd657dbcf138887ae37b Mon Sep 17 00:00:00 2001 From: David Wendt Date: Fri, 24 Jan 2020 23:52:40 -0500 Subject: [PATCH] `post_instantiate` is morally equivalent to duplicating the display object it's called on, so we should also duplicate the XML document attached to it. We don't have to do this for `object` because we don't actually construct the script object until instantiation time. --- core/src/display_object/edit_text.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/display_object/edit_text.rs b/core/src/display_object/edit_text.rs index 33c0e2022..2c698e188 100644 --- a/core/src/display_object/edit_text.rs +++ b/core/src/display_object/edit_text.rs @@ -476,6 +476,12 @@ impl<'gc> TDisplayObject<'gc> for EditText<'gc> { text.object = Some(object); } + + text.document = text + .document + .as_node() + .duplicate(context.gc_context, true) + .document(); } fn object(&self) -> Value<'gc> {