resolve undefined this in onClick handler (#32576)

* resolve undefined this in onClick handler

* add regression test for bound DisambiguatedProfileViewModel onClick

* Update docs

* add regression for sender profile click mention insertion

* Eslint Fix
This commit is contained in:
Zack
2026-02-19 13:55:52 +00:00
committed by GitHub
parent d597fc61d6
commit 134c7cde46
4 changed files with 59 additions and 3 deletions
@@ -141,7 +141,7 @@ export class DisambiguatedProfileViewModel
this.snapshot.set(DisambiguatedProfileViewModel.computeSnapshot(this.props));
}
public onClick(evt: MouseEvent<HTMLDivElement>): void {
public onClick = (evt: MouseEvent<HTMLDivElement>): void => {
this.props.onClick?.(evt);
}
};
}