Closed tyzberd closed 3 months ago
Everything works fine in version 10.2.0. Maybe the issue is on my side.
The issue is with your callbackOnCreateTemplates
code. Various classNames
entries can be arrays not just a single string.
The code (including the example in the readme), use getClassNames
. This might not be exported depending on how you are using the bundles but it is simple enough to re-implement;
export const getClassNames = (ClassNames: Array<string> | string): Array<string> => {
return Array.isArray(ClassNames) ? ClassNames : [ClassNames];
};
getClassNames
as the 3rd argument to callbackOnCreateTemplates
.With v11.0.2 (not yet released), you will be able to replace the line: callbackOnCreateTemplates: function (template) {
with;
callbackOnCreateTemplates: function (template, escapeForTemplate, getClassNames) {
The error occurs in version 11.0.1, but it is not present in version 11.0.0.
jquery-3.6.3.min.js:2 Uncaught InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList': The token provided ('choices choices-currency st-dropdown') contains HTML space characters, which are not valid in tokens. at k (choices.min.js:2:2727) at e.containerOuter (choices.min.js:2:37427) at e._createElements (choices.min.js:2:71755) at e.init (choices.min.js:2:45942) at new e (choices.min.js:2:45495) at HTMLSelectElement. (form-payment-all-country.js:109:36)
at Function.each (jquery-3.6.3.min.js:2:3003)
at E.fn.init.each (jquery-3.6.3.min.js:2:1481)
at Object.init (form-payment-all-country.js:108:34)
at HTMLDocument. (form-payment-all-country.js:192:14)
I am calling this code.