Premium support for our pure JavaScript UI components


Post by srr »

Hello

This is a rather simple issue that I can't seem to find an answer on. I want to display a multi-line message dialog, but it doesn't seem to add a new line when I place \n in my message string. It isn't displaying it as plain text either, so it is being recognised, but without the resulting carriage return. Am i missing something obvious?

You can see from my code snippet below, I want a line break before the "WARNING".

onClick: async () => {
                const result = await MessageDialog.confirm({
                    title: 'Reload Data',
                    message: 'Are you sure you want to reload Scheduler data? \n WARNING: Any changes made will be lost.',
                    okButton: 'Yes',
                    cancelButton: 'No'
                });

But what i am getting is a single line as per the attached.

Attachments
reload-data.PNG
reload-data.PNG (10.93 KiB) Viewed 122 times

Post by marcio »

Hey srr,

You can add the following CSS rule to work as you described (check the screenshot attached).

.b-container.b-panel.b-popup.b-messagedialog.b-messagedialog-confirm {
	max-width: //Your width here
}
Attachments
Screenshot 2023-05-23 at 13.16.52.png
Screenshot 2023-05-23 at 13.16.52.png (278.91 KiB) Viewed 112 times

Best regards,
Márcio


Post by Animal »

Or, just put <br> in there instead. To HTML, a newline is just a whitespace.


Post by srr »

Thanks both. This can be marked as resolved


Post Reply