No need to call toLowerCase on tagName

This commit is contained in:
Matt Bierner
2021-08-13 13:28:54 -07:00
parent ae4e477ccb
commit 6dfd607e8d
@@ -429,7 +429,7 @@ const handleInnerClick = (event) => {
for (const pathElement of event.composedPath()) {
/** @type {any} */
const node = pathElement;
if (node.tagName && node.tagName.toLowerCase() === 'a' && node.href) {
if (node.tagName === 'A' && node.href) {
if (node.getAttribute('href') === '#') {
event.view.scrollTo(0, 0);
} else if (node.hash && (node.getAttribute('href') === node.hash || (baseElement && node.href === baseElement.href + node.hash))) {
@@ -460,7 +460,7 @@ const handleAuxClick =
for (const pathElement of event.composedPath()) {
/** @type {any} */
const node = pathElement;
if (node.tagName && node.tagName.toLowerCase() === 'a' && node.href) {
if (node.tagName === 'A' && node.href) {
event.preventDefault();
return;
}