ngx-toastr
ngx-toastr copied to clipboard
Initial first char message is always a whitespace when enableHTML is false
Hi,
I'm using ngx-toastr to display pre formatted text to indent it with \n or \t. So not in HTML mode. In this config, there is always a white space as first character of message.
When I customize CSS as follow:
.toast-message {
white-space: pre-wrap;
}
the first line of message is not correctly left aligned with others because of the first initial white space which is displayed.
This issue seems to come from template in 'toast.component.ts' where initial space is added due to newline indentation before {{ message }}
<div *ngIf="message && !options.enableHtml" role="alertdialog" aria-live="polite"
[class]="options.messageClass" [attr.aria-label]="message">
{{ message }}
</div>
The issue disappears when template is following:
<div *ngIf="message && !options.enableHtml" role="alertdialog" aria-live="polite"
[class]="options.messageClass" [attr.aria-label]="message">{{ message }}
</div>
Is it possible to correct it? Thank you.