OfficeDev/office-ui-fabric-core

Copy attributes when initializing Dropdown

Closed this issue · 2 comments

This may be more of a feature request since there are a number of work-arounds. However, I find it frustrating that initialized Dropdowns don't copy data attributes (or class or any other attribute for that matter) from the original option elements.

Data attributes in option elements

Obviously copying the id attribute is out of the question, but at the very least, it would be tremendously helpful for the new li elements that are created when the Dropdown is initialized to include data attributes from the original option elements.

Again...there are already plenty of other ways to work with these elements. There's data-binding with frameworks like Knockout, or you can easily use jQuery or vanilla JavaScript to get the nth child of either the select or ul elements to do your own binding.

But still... if the Dropdown's li elements could just be natively initialized with the data from the original option elements, it would save a lot of time writing methods for handling this.

It looks like this is an issue for the Fabric JS repo. Would you mind opening it there?

Thanks Mike, will do.