enketo-core
enketo-core copied to clipboard
Extra space after question reference when used at the beginning of the label
Describe the bug When a question is referenced in another question label at the beginning of that other question label, then an extra space is added after referenced value.
To Reproduce Steps to reproduce the behavior. If applicable please include the smallest possible XLSForm or XForm (as zip or link). space-prefix.xlsx.zip
- Add a hidden field
hiddenField
with default value ABC - Add a text
question1
with${hiddenField}123
at the beginning of the label - Add another text
question2
with${hiddenField}123
not at the beginning of the label - Open survey and see that in
question1
after ABC there is an extra space before 123. This space is not present inquestion2
, which is the expected behavior.
type | name | label | default | required |
---|---|---|---|---|
hidden | hiddenField | hiddenField | ABC | false |
text | question1 | ${hiddenField}123 => a space is added after hiddenField reference | false | |
text | question2 | AnyPrefixText ${hiddenField}123 => no space prefix after hiddenField reference, as expected | false |
Expected behavior No space must be added after reference of the question in another question.
Screenshots
Browser and OS (please complete the following information):
- OS: Linux
- Browser: Firefox 86.0 (64-bit)
Additional context The space is added only if the referenced question is placed at the beginning of the other question label.