vue-scrollto
vue-scrollto copied to clipboard
Fails when trying to scroll to element where ID contains a colon (:)
HTML5 allows elements to have IDs that contain colons, ex:
<div id="#this:isvalid"></div>
However, because this library is using document.querySelector, it is going by CSS selector rules, so a colon in the ID would need to be escaped before calling querySelector, otherwise it would fail with error:
Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#this:isvalid' is not a valid selector.
Had the same error. Would be nice if that could be fixed on the plugin layer, just for others who might stumble upon the problem:
string.replace(':', '\\:')
works
Duplicate of #532 (only with different id characters)