adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
743 stars 750 forks source link

[ContainerUtils] Scroll to anchor logic fails for invalid ID hashes #1900

Closed richardhand closed 2 years ago

richardhand commented 2 years ago

The handling at [0] fails if there exists a URL hash which represents an invalid selector, for example "https://localhost:4502/content/mysite/mypage.html#/invalid". This leads to a console error as follows:

Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#/invalid' is not a valid selector.

See: SITES-3853

[0] https://github.com/adobe/aem-core-wcm-components/blob/master/content/src/content/jcr_root/apps/core/wcm/components/commons/site/clientlibs/container/js/containerUtils.js#L84

bpauli commented 2 years ago

fixed in 53b35201a925d7de1b3cbe64de379e2525e79581