OfficeDev / office-ui-fabric-js

JavaScript components for building experiences for Office and Office 365.
http://dev.office.com/fabric
Other
368 stars 114 forks source link

People Picker - _findElement #364

Closed gunjandatta closed 6 years ago

gunjandatta commented 6 years ago

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;

Code Fix

let currentElement: Element = childObj;
gunjandatta commented 6 years ago

Pull Request has been submitted.

gunjandatta commented 6 years ago

I've done more research, and figured out that the template requires specific elements to be present.