Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Trigger calcUpdate() calls for changes to option labels #414

Closed
wants to merge 1 commit into from

Conversation

alxndrsn
Copy link
Collaborator

Fixes enketo/enketo#370

This is a fix for the example form shown in enketo/enketo#370

I'm not convinced this is safe or optimal for a few reasons:

  • there may be other types of choice which are supported by jr:choice-name, but don't use .option-wrapper
  • I'm not 100% certain how the string passed to calcUpdate() should be calculated, but cutting the form name off the front of the fully-qualified xpath to the model element seems to work (owName.substring( owName.indexOf( '/', 1 ) ))
  • there may be cases when an <output> can occur within .option-wrapper but outside an option label, in which case calcUpdate() will be triggered needlessly

Perhaps if nothing else, this fix will give a clearer insight into what the bug in #410 really is!

@MartijnR
Copy link
Member

What an issue! :) I responded in enketo/enketo#370.

@MartijnR MartijnR closed this May 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jr:choice-name changes are not immediately propagated to all 2nd-level dependencies
2 participants