You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open the Widget Inspector and observe the Semantics tree.
Tap the PopupMenuButton to open the menu.
Observe that the Semantics expanded state does not update to true.
Perform a hot-reload to force a rebuild.
Observe that the Semantics expanded state update properly to true.
Expected results
The Semantics's expanded property should properly update to true when the menu opens and back to false when it closes, so that screen readers can announce the current state.
Actual results
The _isMenuExpanded field is updated without calling setState(), so the Semantics(expanded: _isMenuExpanded) widget doesn't rebuild and the expanded state doesn't updates.
Has the same pattern — _handleTap() and _removeDropdownRoute() set _isMenuExpanded without setState()
Currently masked by _handleFocusChanged, which happens to call setState() whenever focus changes on open/close, but should still be fixed to not rely on this side effect
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.41.2, on macOS 26.3.1 25D2128 darwin-arm64, locale en-EG) • Flutter version 3.41.2 on channel stable • Framework revision 90673a4eef (3 weeks ago), 2026-02-18 13:54:59 -0800 • Engine revision 6c0baaebf7 • Dart version 3.11.0 • DevTools version 2.54.1[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) • Platform android-36, build-tools 36.0.0 • Java version OpenJDK Runtime Environment JBR-21.0.6+9-895.97-nomod (build 21.0.6+9-b895.97) • All Android licenses accepted.[✓] Xcode - develop for iOS and macOS (Xcode 26.3) • Build 17C529 • CocoaPods version 1.16.2[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome[✓] Connected device (3 available)[✓] Network resources • All expected network resources are available.• No issues found!
Steps to reproduce
PopupMenuButtonto open the menu.expandedstate does not update totrue.expandedstate update properly totrue.Expected results
The
Semantics'sexpandedproperty should properly update totruewhen the menu opens and back tofalsewhen it closes, so that screen readers can announce the current state.Actual results
The
_isMenuExpandedfield is updated without callingsetState(), so theSemantics(expanded: _isMenuExpanded)widget doesn't rebuild and theexpandedstate doesn't updates.Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
Screen.Recording.2026-03-10.at.6.10.17.AM.mp4
Root cause
_isMenuExpandedis updated without callingsetState(), so theSemantics(expanded: _isMenuExpanded)widget never rebuilds.PopupMenuButton:
showButtonMenu()sets_isMenuExpanded = truewithoutsetState().then()callback sets_isMenuExpanded = falsewithoutsetState()setState()call anywhere inPopupMenuButtonState, soexpandednever updates at allDropdownButton:
_handleTap()and_removeDropdownRoute()set_isMenuExpandedwithoutsetState()_handleFocusChanged, which happens to callsetState()whenever focus changes on open/close, but should still be fixed to not rely on this side effectFlutter Doctor output
Doctor output