···363363364364 for (const candidate of candidates) {
365365 if (isElement(candidate) && localName === candidate.localName) {
366366+ if (isInputElement(candidate) && isInputElement(node) && candidate.type !== node.type) {
367367+ // Treat inputs with different type as though they are different tags.
368368+ continue
369369+ }
366370 matches.set(node, candidate)
367371 unmatched.delete(node)
368372 candidates.delete(candidate)