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:
@@ -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);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user