Use emit() instead of dispatchEvent(new Event()) for consistency.