There is the potential that we allow a double error panel on the textarea component and one of our tests even uses configuration that would produce this bug.
This is that config:
{% from "components/textarea/_macro.njk" import onsTextarea %}
{{
onsTextarea({
"id": "textarea-error",
"name": "feedback",
"label": {
"text": "Please provide some feedback",
"description": "For example, describe any difficulties you experienced in the use of this service"
},
"error": {
"id": "feedback-error",
"text": "Enter your feedback"
},
"dontWrap": true,
"mutuallyExclusive": {
"or": 'Or',
"deselectMessage": 'Selecting this will clear your feedback',
"deselectGroupAdjective": 'cleared',
"deselectExclusiveOptionAdjective": 'deselected',
"exclusiveOptions": [
{
"id": 'feedback-exclusive-option',
"name": 'no-feedback',
"value": 'no-feedback',
"label": {
"text": 'I dont want to provide feedback'
}
}
]
}
})
}}
This is what it renders:
This is caused because there is an extra field being added in the macro with the error param passed.
The call to onsField around the field variable needs to be removed and the test still renders field component testing for that field also needs to be removed.
Like here in this commit
What was the expected outcome?
Only one error panel is rendered around the textarea.
How is this problem impacting your service?
N/A
What list of steps can be followed to reproduce the bug or issue?
Go to the "still renders field component" test in src/components/textarea/_macro.spec.js
Edit an example to use the configuration from EXAMPLE_TEXTAREA_WITH_MUTUALLY_EXCLUSIVE_WITH_ERROR that the test uses (provided above)
Spin up the DS and navigate to that example
See that there are 2 error panels rendered inside each other
Example
Above
What version of the ONS Design System are you using?
Latest
What devices are you seeing the problem on?
All
Device details
N/A
What operating systems are you seeing the problem on?
What happened?
There is the potential that we allow a double error panel on the textarea component and one of our tests even uses configuration that would produce this bug. This is that config:
This is what it renders:
This is caused because there is an extra field being added in the macro with the error param passed.
The call to
onsField
around thefield
variable needs to be removed and the teststill renders field component
testing for that field also needs to be removed. Like here in this commitWhat was the expected outcome?
Only one error panel is rendered around the textarea.
How is this problem impacting your service?
N/A
What list of steps can be followed to reproduce the bug or issue?
src/components/textarea/_macro.spec.js
EXAMPLE_TEXTAREA_WITH_MUTUALLY_EXCLUSIVE_WITH_ERROR
that the test uses (provided above)Example
Above
What version of the ONS Design System are you using?
Latest
What devices are you seeing the problem on?
All
Device details
N/A
What operating systems are you seeing the problem on?
All
Operating system details
N/A
What browsers are you seeing the problem on?
All
Browser details
N/A