Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast messages don't respect line breaks #34

Open
Erudition opened this issue Jul 31, 2019 · 1 comment
Open

Toast messages don't respect line breaks #34

Erudition opened this issue Jul 31, 2019 · 1 comment

Comments

@Erudition
Copy link

I can not figure out how to create line breaks in a toast message. When on Android, for example, I can use \n to insert a newline, which works great. However, the same messages are being flattened to one line in the PWA, which looks ugly. Is there a way to represent line breaks?

I'm submitting a ...
[x] bug report
[x] feature request
[x] support request

Current behavior:
All whitespace (\n, \t, multiple spaces in a row) in the input text of the Toast plugin seems to be normalized to a single space. When I try to use HTML line breaks like <br />, they are passed through un-parsed.

Expected behavior:
There should be a way to represent line breaks in the toast messages, like on other Capacitor-supported platforms. Ideally this should simply respect the \n character so toast works identically across platforms.

Steps to reproduce:
On a browser page with both pwa elements and capacitor.js, paste in the developer console:

window.Capacitor.Plugins.Toast.show({ text: "0m 11s spent on Meditate \n Meditate ➤ Workout \n Starting from 0m 0s", duration: '10000'}).then();
@sneko
Copy link

sneko commented Jul 7, 2021

I agree with @Erudition . Any thought @mlynch ?

Thank you,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants