-
Notifications
You must be signed in to change notification settings - Fork 338
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
Fix conditional reveal fullstop. #2270
Fix conditional reveal fullstop. #2270
Conversation
Hey @natcarey, Thanks for raising this. Based on your explanation and the code change I think that this is the same issue as #1808. Can you take a look and see if you agree? We've got an alternate fix which we've previously explored – switching to using Unfortunately, because this changes the scope of the lookup from the However, we were already planning to include that fix in 4.0 which is now likely to be the next release – at the minute we have no plans to do any more 3.x releases. How does that sound? Can you wait for a proper fix in the 4.0 release? |
There are a few answers here:
I'm going to update the PR to include |
e324147
to
de275cb
Compare
I've updated this to deal with all special chars, to be clear this is a nonbreaking change and doesn't change the scope of the selector. |
Not de-scoping this from v4.0.0, but removing it from the milestone as the associated issue is already linked there. |
We're going to go with the approach in #2370 instead – replacing the calls to Thanks again @natcarey – really appreciate you taking the time to put this together. |
Fixes #1808
While working with an HMRC service team I discovered this bug. The service had used IDs with a full stop in them implying hierarchy. The format was roughly
question1.option1
. This is valid HTML but due to the selectors in the JS this was turning into the selector#questoin1.option1
which looks for an element with an ID ofquestion1
as well as a class ofoption1
. This change escapes the full stop to make the query#question1\.option1
which will look for an ID ofquestion1.answer1
.In the process of fixing this it became clear that some of the examples and tests (as well as real production code) have situations where a selector of
#null
will be used, this occurs when some items have conditional reveal and others don't. I've checked for this case and therefore#null
will no longer be used.This is intended to be backward compatible and to only fix the bugs related to the issues we've experienced in one of our services.