-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Describe the bug
When one of the items passed into a tabs component is a textarea, with a value that has a multiline string, the textarea input gets indented.
https://github.com/LandRegistry/govuk-frontend-jinja/blob/main/govuk_frontend_jinja/templates/components/tabs/macro.html#L45
https://github.com/LandRegistry/govuk-frontend-jinja/blob/main/govuk_frontend_jinja/templates/components/tabs/macro.html#L19
It is seemingly not safe to use indent() on textareas, because it can change the value passed in.
To Reproduce
Steps to reproduce the behavior:
- Setup a wtform with a stringfield using a govuktextarea widget.
- Instantiate the form and pass some multiline text data to the field
- Render the textarea using govukTextarea inside a govukTabs component.
- See that lines 2+ are prefixed with 4 spaces.
Expected behavior
The value of the textarea is not changed by rendering it inside a tabs component.
Screenshots
With native govuk-frontend-jinja macro
With modified govuk-frontend-jinja macro (all indent() calls removed)

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels