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

Callout: intended use of ms-Callout-close #352

Closed irwinb closed 6 years ago

irwinb commented 6 years ago

The callout component registers a click handler on an element using

this._closeButton = document.querySelector(CLOSE_BUTTON_CLASS);

As a result, if you have multiple callouts on a page with close buttons, the component only attempts to close the first callout. Only one callout can be open at one time but the close button does nothing on all but the first callout.

It should probably do something like the following in the constructor:

this._closeButton = container.querySelector(CLOSE_BUTTON_CLASS);