-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Textarea misses the first line if empty #238
Comments
Do you have an example of this? I do not have a reproducible example of this |
|
The HTML spec is surprisingly vague about this, but it looks like browsers strip an initial |
quis
added a commit
to alphagov/notifications-admin
that referenced
this issue
Apr 23, 2020
This involves three changes which broke our code. To validate email addresses, the optional dependency `email-validator` must be installed<sup>1</sup>. But since we don’t use WTForms’ email validation, we shouldn’t need to do this. Instead this commit makes our own `EmailField`, which just handles rendering the field as an email field, not validating that (because we add the validation elsewhere). When rendering textareas, and extra `\r\n` is inserted at the beginning <sup>2</sup>. Browsers will strip this when displaying the textbox and submitting the form, but some of our tests need updating to account for this. The error message for when you don’t choose an option from some radio buttons has now changed. Rather than just accepting WTForms’ new message, this commit makes the error messages like the examples from the Design System<sup>3</sup>. By default it will say ‘Select an option’, but by passing in an extra parameter (`thing`) it can be customised to be more specific, for example ‘Select a type of organisation’. *** 1. pallets-eco/wtforms#429 2. pallets-eco/wtforms#238 3. https://design-system.service.gov.uk/components/radios/#error-messages
quis
added a commit
to alphagov/notifications-admin
that referenced
this issue
Apr 23, 2020
This involves three changes which broke our code. To validate email addresses, the optional dependency `email-validator` must be installed<sup>1</sup>. But since we don’t use WTForms’ email validation, we shouldn’t need to do this. Instead this commit makes our own `EmailField`, which just handles rendering the field as an email field, not validating that (because we add the validation elsewhere). When rendering textareas, and extra `\r\n` is inserted at the beginning <sup>2</sup>. Browsers will strip this when displaying the textbox and submitting the form, but some of our tests need updating to account for this. The error message for when you don’t choose an option from some radio buttons has now changed. Rather than just accepting WTForms’ new message, this commit makes the error messages like the examples from the Design System<sup>3</sup>. By default it will say ‘Select an option’, but by passing in an extra parameter (`thing`) it can be customised to be more specific, for example ‘Select a type of organisation’. *** 1. pallets-eco/wtforms#429 2. pallets-eco/wtforms#238 3. https://design-system.service.gov.uk/components/radios/#error-messages
quis
added a commit
to alphagov/notifications-admin
that referenced
this issue
Apr 23, 2020
This involves three changes which broke our code. To validate email addresses, the optional dependency `email-validator` must be installed<sup>1</sup>. But since we don’t use WTForms’ email validation, we shouldn’t need to subclass it – it can just be its own self contained thing. Then we don’t need to add the extra dependency. When rendering textareas, and extra `\r\n` is inserted at the beginning <sup>2</sup>. Browsers will strip this when displaying the textbox and submitting the form, but some of our tests need updating to account for this. The error message for when you don’t choose an option from some radio buttons has now changed. Rather than just accepting WTForms’ new message, this commit makes the error messages like the examples from the Design System<sup>3</sup>. By default it will say ‘Select an option’, but by passing in an extra parameter (`thing`) it can be customised to be more specific, for example ‘Select a type of organisation’. *** 1. pallets-eco/wtforms#429 2. pallets-eco/wtforms#238 3. https://design-system.service.gov.uk/components/radios/#error-messages
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When saving a textarea with the first line empty (leading line break), the browser won't show that line after viewing the changed form, but the data sent to the server is correct. And then we save it again with nothing changed, data sent to the server also misses that line.
The text was updated successfully, but these errors were encountered: