The year and method dropdowns are now disabled (grayed out) while data is being loaded:
- County dropdown changed → Year and Method dropdowns disabled
- Year dropdown populated → Year dropdown enabled, Method still disabled
- Method dropdown populated → Method dropdown enabled
- Data loaded → All dropdowns enabled
Disabled dropdowns have reduced opacity (0.5) to clearly show they're not interactive yet.
If a county has no data for any year, or a year has no voting methods, the dropdown shows "No data available" instead of being empty.
File: WhoVoted/public/dataset-selector-v2.js
populateYearDropdown() {
// Disable year and method dropdowns while loading
this.yearSelect.disabled = true;
this.methodSelect.disabled = true;
this.yearSelect.style.opacity = '0.5';
this.methodSelect.style.opacity = '0.5';
// ... populate years ...
// Re-enable year dropdown when done
this.yearSelect.disabled = false;
this.yearSelect.style.opacity = '1';
this.populateMethodDropdown();
}populateMethodDropdown() {
// Keep method dropdown disabled while loading
this.methodSelect.disabled = true;
this.methodSelect.style.opacity = '0.5';
// ... populate methods ...
// Re-enable method dropdown when done
this.methodSelect.disabled = false;
this.methodSelect.style.opacity = '1';
this.loadCurrentDataset();
}- All dropdowns always enabled
- User could select options before data was ready
- Confusing when dropdowns showed wrong data
- Clear visual feedback when dropdowns are loading
- User can't interact with dropdowns until data is ready
- Prevents selecting invalid combinations
- Select a county (e.g., "Angelina")
- Observe: Year and Method dropdowns become grayed out
- After ~100ms: Year dropdown becomes enabled, shows available years
- After ~100ms more: Method dropdown becomes enabled, shows available methods
- Map loads with correct county data
The stats box at the top may still show "Hidalgo County" even when a different county is selected. This is because:
- The
updateDatasetStatsBox()function indata.jsusesselectedCountyFiltervariable - The
_fetchAndDisplayStats()function also usesselectedCountyFilter - These need to be updated BEFORE the dataset is loaded
Status: The selectedCountyFilter is being updated in onCountyChange(), but there may be a timing issue or the stats box isn't being refreshed properly.
Next Steps:
- Verify
selectedCountyFilteris set correctly beforeloadDataset()is called - Add console logging to track when stats box is updated
- Ensure stats box refresh happens AFTER new data is loaded
- Commit:
3c06297 - Deployed to:
/opt/whovoted - Users need hard refresh (Ctrl+Shift+R)
COUNTY_SELECTION_FIX.md- County selection and filtering fixesTHREE_DROPDOWN_FIX_COMPLETE.md- Initial three-dropdown implementation