add comment on _active_element ordering constraint

This commit is contained in:
egrs
2026-02-18 14:50:20 +01:00
parent a21bb6b02d
commit 377fe5bc40

View File

@@ -799,6 +799,8 @@ pub fn focus(self: *Element, page: *Page) !void {
try page._event_manager.dispatch(old_target, focusout_event.asEvent()); try page._event_manager.dispatch(old_target, focusout_event.asEvent());
} }
// Must be set after blur/focusout and before focus/focusin —
// event dispatch can reset _active_element if set earlier.
if (self.asNode().isConnected()) { if (self.asNode().isConnected()) {
page.document._active_element = self; page.document._active_element = self;
} }