characterCounter is not working as described here: http://next.materializecss.com/text-inputs.htmlcharacterCounter without jquery?VM3795:1 Uncaught TypeError: $(...).characterCounter is not a function
at <anonymous>:1:37
Can you make a codepen? I can't help without seeing any code.
Hi @acburst,
I think the docs are not up-to-date with the character counter.
The only code sample provided is using jQuery.
Could you please update the docs accordingly?
http://next.materializecss.com/text-inputs.html#character-counter
I got it working after checking the JS code with the new M.CharacterCounter.init() function.
Is this necessary? If I am not mistaken, in versions prior to 1.0 the character counter was initialized automatically if the data-length attribute was present on the input.
M.CharacterCounter.init(document.querySelectorAll('.has-character-counter'));
Most helpful comment
Hi @acburst,
I think the docs are not up-to-date with the character counter.
The only code sample provided is using jQuery.
Could you please update the docs accordingly?
http://next.materializecss.com/text-inputs.html#character-counter
I got it working after checking the JS code with the new
M.CharacterCounter.init()function.Is this necessary? If I am not mistaken, in versions prior to 1.0 the character counter was initialized automatically if the
data-lengthattribute was present on the input.M.CharacterCounter.init(document.querySelectorAll('.has-character-counter'));