0

I am trying to create a multiple line webpart property using this code: PropertyPaneTextField('test', { label: 'Multi-line Text Field', multiline: true }),

As described in the docs, however, when i type multiple lines in the field, they're just displayed as one line only in the UI. Is there a way to let the user type what they want, and the result is displayed as is in the UI?

1

You can try escaping the property value and then replacing %0A with <br/>. Like this
let propVal:string = escape(this.properties.test).replace(/%0A/g,"<br/>")

0

when you use multiline: true property, it enables you to enter the number of rows you want to display via the property rows?: number. This will help you display text field as text area.

PropertyPaneTextField('test', {
                  label: 'Multi-line Text Field',
                  multiline: true,
                  rows: 5
                }),
  • I just tried it, it doesn't have any effect. This is my code: ` PropertyPaneTextField('test', { label: 'Multi-line Text Field', multiline: true, rows: 5 }), ` Still the output it displayed as one row, and it wraps when the div reaches the end, but I want the the text to be displayed the same way the user types it in the property. – brittany May 13 '18 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.