Skip to content

Commit 22e3ade

Browse files
committed
fix: 🐛 fix semantics issue when using go router (#622)
1 parent 65c1929 commit 22e3ade

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Feature [#600](https://github.com/SimformSolutionsPvtLtd/showcaseview/issues/600) - Added dynamic onComplete callback registration with `addOnCompleteCallback` and `removeOnCompleteCallback` methods
77
- Fixed [#577](https://github.com/SimformSolutionsPvtLtd/showcaseview/issues/577) - Resolve issue where long tooltip text was rendered outside the screen bounds
88
- Feature [#586](https://github.com/SimformSolutionsPvtLtd/showcaseview/issues/586): Enhance tooltip accessibility using Semantics live region
9+
- Fixed [#622](https://github.com/SimformSolutionsPvtLtd/showcaseview/issues/622) - Resolve Semantics issue when using `go_router` and `showSemanticsDebugger` flag
910

1011
## [5.0.1]
1112

lib/src/utils/overlay_manager.dart

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,19 @@ class OverlayManager {
213213

214214
// Wrap with other inherited widgets to maintain showcase's context's
215215
// inherited values.
216-
return Directionality(
217-
textDirection: inheritedData.textDirection,
218-
child: MediaQuery(
219-
data: inheritedData.mediaQuery,
220-
child: DefaultTextStyle(
221-
style: inheritedData.textStyle,
222-
child: themedChild,
216+
// Wrapping with Semantics to control accessibility based on
217+
// `isSemanticsEnabled` flag.
218+
return Semantics(
219+
liveRegion: showcaseView.semanticEnable,
220+
excludeSemantics: !showcaseView.semanticEnable,
221+
child: Directionality(
222+
textDirection: inheritedData.textDirection,
223+
child: MediaQuery(
224+
data: inheritedData.mediaQuery,
225+
child: DefaultTextStyle(
226+
style: inheritedData.textStyle,
227+
child: themedChild,
228+
),
223229
),
224230
),
225231
);

0 commit comments

Comments
 (0)