Skip to content

Commit

Permalink
Fix selector going under keyboard (#352)
Browse files Browse the repository at this point in the history
Fixes #317
  • Loading branch information
Amir-P authored Jun 15, 2024
1 parent 810ce7a commit 81a4081
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions packages/fleather/lib/src/widgets/editor_toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1245,22 +1245,22 @@ class SelectorScopeState extends State<SelectorScope> {
overlayBox.size,
);

final mediaQueryData = MediaQuery.of(context);
final textDirection = Directionality.of(context);

_overlayEntry = OverlayEntry(
builder: (context) => CustomSingleChildLayout(
delegate: _SelectorLayout(
position,
textDirection,
mediaQueryData.padding,
DisplayFeatureSubScreen.avoidBounds(mediaQueryData).toSet(),
),
child: TapRegion(
child: selector,
onTapOutside: (_) => completer.complete(null),
),
),
builder: (context) {
final mediaQueryData = MediaQuery.of(context);
return CustomSingleChildLayout(
delegate: _SelectorLayout(
position,
Directionality.of(context),
mediaQueryData.padding + mediaQueryData.viewInsets,
DisplayFeatureSubScreen.avoidBounds(mediaQueryData).toSet(),
),
child: TapRegion(
child: selector,
onTapOutside: (_) => completer.complete(null),
),
);
},
);
_overlayEntry?.addListener(() {
if (_overlayEntry?.mounted != true && !completer.isCompleted) {
Expand Down

0 comments on commit 81a4081

Please sign in to comment.