fix event attach too early crashing

This commit is contained in:
Face
2025-09-10 21:36:53 +03:00
parent cf62a9b722
commit b060f6ea80
2 changed files with 15 additions and 0 deletions

View File

@@ -583,6 +583,9 @@ static func create_element_wrapper(vm: LuauVM, element: HTMLParser.HTMLElement,
if element_id.is_empty():
element_id = lua_api.get_or_assign_element_id(element)
element.set_attribute("id", element_id)
# Update the DOM node registration with the new ID
lua_api.dom_parser.update_dom_node_id(element, element_id)
vm.lua_pushstring(element_id)
vm.lua_setfield(-2, "_element_id")