I've tried to use the sample code to create a people picker, but the user selection wasn't working unless you selected the name. Clicking on the space to the right of the name would throw an error. The code update is safer in my opinion, searching the current element wouldn't hurt performance and adds an extra check.
Shouldn't the find element method default to the base element?
Original Code
let currentElement: Element = <Element>childObj.parentNode;
I've tried to use the sample code to create a people picker, but the user selection wasn't working unless you selected the name. Clicking on the space to the right of the name would throw an error. The code update is safer in my opinion, searching the current element wouldn't hurt performance and adds an extra check.
Shouldn't the find element method default to the base element?
Original Code
Code Fix