md-option will not accept a slot that includes anything other than text elements. If you try to pass HTML or an icon etc, it will throw a nasty error in your face because of the way the getTextContent function is written.
Which browser?
All
What is expected?
Should be able to pass a slot with whatever HTML you want
What is actually happening?
An error is thrown in the getTextContent function because it hits an undefined value if you pass HTML into the slot.
Proposed fix
The getTextContent function could be redefined like this to avoid failure if HTML content is passed in:
getTextContent (children) {
let that = this;
return children.map(function (node) {
return node.children
? that.getTextContent(node.children)
: node.text
}).join('')
},
The setItem function could be redefined like this:
md-option will not accept a slot that includes anything other than text elements. If you try to pass HTML or an icon etc, it will throw a nasty error in your face because of the way the
getTextContent
function is written.Which browser?
All
What is expected?
Should be able to pass a slot with whatever HTML you want
What is actually happening?
An error is thrown in the
getTextContent
function because it hits an undefined value if you pass HTML into the slot.Proposed fix
The
getTextContent
function could be redefined like this to avoid failure if HTML content is passed in:The
setItem
function could be redefined like this: