enketo-core icon indicating copy to clipboard operation
enketo-core copied to clipboard

Extra space after question reference when used at the beginning of the label

Open nmandrescu opened this issue 3 years ago • 0 comments

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

  1. Add a hidden field hiddenField with default value ABC
  2. Add a text question1 with ${hiddenField}123 at the beginning of the label
  3. Add another text question2 with ${hiddenField}123 not at the beginning of the label
  4. Open survey and see that in question1 after ABC there is an extra space before 123. This space is not present in question2, 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 space

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.

nmandrescu avatar Mar 09 '21 10:03 nmandrescu