I am currently working on an SPFx webpart.
Within my property pane I have:
PropertyPaneTextField('CreateNewVerticalNav', {
label: 'Create New Vertical Nav',
multiline: true,
placeholder: 'Enter HTML...'
})
My idea here is to create a text area where markup can be entered.
I am currently accessing the entered in markup like such:
let inputNavHTML: string = this.properties.CreateNewVerticalNav;
$('#accordion-container').append(inputNavHTML);
The code above works as expected. As it produces:
However, I have read that all Property Pane properties need to be escaped with escape() to avoid script injections, but when I adjust the code like such:
let inputNavHTML: string = escape(this.properties.CreateNewVerticalNav);
The entered in markup doesn't append as expected. As it produces:
Has anyone been successful in allowing markup to be entered in their text areas and been able to append them to their webpart?
Thank you!