diff --git a/report/renderer/performance-category-renderer.js b/report/renderer/performance-category-renderer.js index cfa372e7f273..0db8e27ff4d5 100644 --- a/report/renderer/performance-category-renderer.js +++ b/report/renderer/performance-category-renderer.js @@ -311,11 +311,15 @@ export class PerformanceCategoryRenderer extends CategoryRenderer { ({acronym: 'All'}), ...filterableMetrics, ]); + + // Form labels need to reference unique IDs, but multiple reports rendered in the same DOM (eg PSI) + // would mean ID conflict. To address this, we 'scope' these radio inputs with a unique suffix. + const uniqSuffix = Util.getUniqueSuffix(); for (const metric of filterChoices) { - const elemId = `metric-${metric.acronym}`; + const elemId = `metric-${metric.acronym}-${uniqSuffix}`; const radioEl = this.dom.createChildOf(metricFilterEl, 'input', 'lh-metricfilter__radio'); radioEl.type = 'radio'; - radioEl.name = 'metricsfilter'; + radioEl.name = `metricsfilter-${uniqSuffix}`; radioEl.id = elemId; const labelEl = this.dom.createChildOf(metricFilterEl, 'label', 'lh-metricfilter__label');