I've recently upgraded from v2.5.2 to v2.6.0 and ran across a tiny issue with the $.parseHTML update when using the select2 plugin. I believe this issue addresses that update:
I narrowed it down to the ruleValueSelect template leaving a single space at the beginning of the template and then $.parseHtml parses that out as an individual array item. When select2 tries to an apply an id to that item by using getAttribute the error occurs. See below:
The jQuery docs recommended using jQuery.trim in order to prevent trailing/leading whitespace from being converted to text nodes. That indeed did resolve the issue. Here's a PR with the change:
I've recently upgraded from v2.5.2 to v2.6.0 and ran across a tiny issue with the
$.parseHTML
update when using the select2 plugin. I believe this issue addresses that update:https://github.com/mistic100/jQuery-QueryBuilder/issues/905
I narrowed it down to the
ruleValueSelect
template leaving a single space at the beginning of the template and then$.parseHtml
parses that out as an individual array item. When select2 tries to an apply an id to that item by usinggetAttribute
the error occurs. See below:The jQuery docs recommended using
jQuery.trim
in order to prevent trailing/leading whitespace from being converted to text nodes. That indeed did resolve the issue. Here's a PR with the change:https://github.com/mistic100/jQuery-QueryBuilder/pull/923
Here's a fiddle with the issue:
https://jsfiddle.net/6qyLvhpb/1/
Just need to make a selection and watch the console to see the error.
Thanks!