Skip to content

Commit 55f6395

Browse files
committed
fix: 🐛 fix semantics issue when using go router (#622)
1 parent 5afab59 commit 55f6395

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
@@ -7,6 +7,7 @@
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
99
- Feature [#624](https://github.com/SimformSolutionsPvtLtd/showcaseview/pull/624): Added dynamic onStart callback registration with `addOnStartCallback` and `removeOnStartCallback` methods
10+
- Fixed [#622](https://github.com/SimformSolutionsPvtLtd/showcaseview/issues/622) - Resolve Semantics issue when using `go_router` and `showSemanticsDebugger` flag
1011

1112
## [5.0.1]
1213

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)