Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Bug: when errorElement isn't label and name contains "[" "]" errorsFor doesn't return element (fix included) #1269
If I have an element with this name and id:
And I'm not using a "label" as the errorElement, then it doesn't find the existing errorElement and keeps on creating new ones.
The problem arises because the describer is set as the id, and then in the errorsFor function it uses that directly as the jquery selector. The brackets need to be escaped.
Line 824 fix for errorsFor:
Line 789 fix for describedBy not matching either and getting duplicated:
That will properly escape the brackets.