Skip to content
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

Wrongly calculated value in first repeat group when used with once function #636

Closed
grzesiek2010 opened this issue Jun 28, 2021 · 2 comments

Comments

@grzesiek2010
Copy link
Member

Problem description

The problem has been discovered on the forum: https://forum.getodk.org/t/default-value-to-repeat-from-outside-repeat/33997/

Steps to reproduce the problem

  1. Open the attached form:
    Default to Repeat.xlsx
  2. Answer Current Job question
  3. Navigate to the next question which should display the answer passed in step 2 but it is just the first letter of that answer

Other information

Removing once() in row 8 fixes the issue.

@lognaturel
Copy link
Member

lognaturel commented Jun 28, 2021

Were you able to reproduce without a field list? Did you try using dynamic defaults (set value) instead of once()? The goal is to have a dynamic default that is user-editable so one or the other is critical for this usecase.

At first reading it doesn’t look like a JR problem. I believe it’s because it’s hitting the field-list recomputation triggered by Collect as soon as there’s a single character. I would expect the TextWatcher stuff to only apply to user-provided content so I’m not sure how but that’s the direction I would look in.

@lognaturel
Copy link
Member

This is working as expected because the value that is wrapped in once is in a field-list. That means it is committed to the form character-by-character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants