Skip to content

Commit

Permalink
🐛 Fix close button semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Dec 9, 2023
1 parent 4b0380e commit 08ef009
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/src/delegates/asset_picker_builder_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,11 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
padding: const EdgeInsets.symmetric(vertical: 4),
child: IconButton(
onPressed: Navigator.of(context).maybePop,
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
icon: const Icon(Icons.close),
tooltip: MaterialLocalizations.of(context).closeButtonTooltip,
icon: Icon(
Icons.close,
semanticLabel: MaterialLocalizations.of(context).closeButtonTooltip,
),
),
);
}
Expand Down
7 changes: 5 additions & 2 deletions lib/src/delegates/asset_picker_viewer_builder_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,12 @@ class DefaultAssetPickerViewerBuilderDelegate
leading: Semantics(
sortKey: ordinalSortKey(0),
child: IconButton(
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
onPressed: Navigator.of(context).maybePop,
icon: const Icon(Icons.close),
tooltip: MaterialLocalizations.of(context).closeButtonTooltip,
icon: Icon(
Icons.close,
semanticLabel: MaterialLocalizations.of(context).closeButtonTooltip,
),
),
),
centerTitle: true,
Expand Down

0 comments on commit 08ef009

Please sign in to comment.