Skip to content

Fix map layers select dropdown menu state to reset when Map Layers switch is toggled#1698

Merged
wilmaier merged 2 commits into
masterfrom
fix/map-layers-select-dropdown-menu-reset
May 27, 2026
Merged

Fix map layers select dropdown menu state to reset when Map Layers switch is toggled#1698
wilmaier merged 2 commits into
masterfrom
fix/map-layers-select-dropdown-menu-reset

Conversation

@wilmaier

Copy link
Copy Markdown
Contributor

Fixed map layers dropdown selection menu by adding key property to Select component to reset internal state when disabled changes, ensuring the dropdown menu is responsive.

Steps to test:

  • Enable Map layers toggle.
  • Click on drop down to look for the available layers.
  • Now switch Off the toggle.
  • Press on disabled layers dropdown field.
  • Re-enable the Map Layers toggle.
  • Click on the drop down to look for available layers one more time.
  • Check that the dropdown is working and that user can select a map layer from the dropdown.

Copilot AI review requested due to automatic review settings May 27, 2026 19:48
@wilmaier wilmaier requested review from a team, eringram and mdastous-bentley as code owners May 27, 2026 19:48
@wilmaier wilmaier added the bug Something isn't working label May 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a stale dropdown state issue in the Map Layers basemap Select component by forcing a remount via a key prop when the disabled prop changes.

Changes:

  • Added key={String(props.disabled)} to the basemap Select component to reset internal state when toggled.
  • Added a change log entry for the @itwin/map-layers package.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/itwin/map-layers/src/ui/widget/BasemapPanel.tsx Adds key prop on Select to reset internal state on disabled change
change/@itwin-map-layers-450debab-e24a-42a0-9785-ce0c8157dbe7.json Patch changelog entry for the fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wilmaier wilmaier merged commit 43f174c into master May 27, 2026
13 checks passed
@wilmaier wilmaier deleted the fix/map-layers-select-dropdown-menu-reset branch May 27, 2026 20:24
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.

3 participants