Skip to content

fix: initialize ComboboxArea with default selected area#74

Merged
fityannugroho merged 1 commit intomainfrom
fix-area-selector
Aug 25, 2025
Merged

fix: initialize ComboboxArea with default selected area#74
fityannugroho merged 1 commit intomainfrom
fix-area-selector

Conversation

@fityannugroho
Copy link
Owner

@fityannugroho fityannugroho commented Aug 25, 2025

Summary

This PR fixes the area selector behavior by passing the currently selected area into the Combobox on mount.

Changes

  • components/ComboboxArea.tsx: add defaultSelected prop and initialize internal selectedArea state from it.
  • modules/MapDashboard/AreaSelectors.tsx: pass selectedArea[area] as defaultSelected to ComboboxArea.

Why

Previously the combobox did not reflect the existing selection when the selector UI mounted. This ensures the UI shows the current selection immediately.

How to test

  1. Open the map dashboard and verify the area comboboxes display the currently selected area.
  2. Select a different area and ensure linked child selectors update.

Checklist:

  • Pass current selected area to ComboboxArea
  • Initialize ComboboxArea internal state from prop
  • Verified changes are minimal and localized

@fityannugroho fityannugroho added the bug Something isn't working label Aug 25, 2025
@fityannugroho fityannugroho changed the title fix(area-selectors): initialize ComboboxArea with default selected area fix: initialize ComboboxArea with default selected area Aug 25, 2025
@fityannugroho fityannugroho merged commit 9e12fc6 into main Aug 25, 2025
10 of 12 checks passed
@fityannugroho fityannugroho deleted the fix-area-selector branch August 25, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant