bcgov / bcgov/popApp

Duplicate Shiny IDs break Region, Year and Gender label associations

Open Beginner friendly
#18 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
R
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Hi! 👋 I was testing the live popApp on Windows 11 / Chrome 151 and noticed Shiny reporting duplicate input/output IDs for Region.Name, Year, and Gender.

I confirmed each ID appears twice in the DOM:

document.querySelectorAll('#Year').length // 2
document.querySelectorAll('#Gender').length // 2
document.querySelectorAll('#Region\.Name').length // 2

The visible labels also aren't programmatically associated with their controls:

document.querySelector('label[for=Year]')?.control // null
document.querySelector('label[for=Gender]')?.control // null
document.querySelector('label[for=Region.Name]')?.control // null

It looks like the uiOutput() containers share IDs with the selectInput() elements rendered inside them.

The interesting part is that the interface still looks fine visually, while the semantic wiring underneath is disconnected. That can matter for screen readers, speech and assistive tools, automated testing, and JavaScript that needs to reliably target a specific control.

A small fix could be to give the UI outputs unique IDs such as Year_ui while preserving the existing input IDs.

Happy to put together a PR if useful. 🌲 Thanks for maintaining the app!

Contributor guide

Open the contributing guide

Research direction

Start by locating the UI definitions that pair uiOutput() with selectInput() for Region.Name, Year, and Gender. Verify the existing input IDs remain unchanged while the output container IDs are unique, then use the reported DOM queries to confirm each control appears once and its label resolves to the control.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, r
Domain
accessibility, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.