@@ -60,17 +60,17 @@ class PopupState extends State<Popup> {
60
60
@override
61
61
Widget build (BuildContext context) {
62
62
final verticalFlipRequired = _isVerticalFlipRequired ();
63
- final bool horizontalOverflow =
64
- widget.normalOffset.dx + Sizes .autocompletePopupMaxWidth >
65
- widget.editingWindowSize.width;
63
+ final bool isHorizontalOverflowed = _isHorizontallyOverflowed ();
66
64
final double leftOffsetLimit =
67
65
// TODO(nausharipov): find where 100 comes from
68
- widget.editingWindowSize.width - Sizes .autocompletePopupMaxWidth - 100 ;
66
+ widget.editingWindowSize.width -
67
+ Sizes .autocompletePopupMaxWidth +
68
+ (widget.editorOffset? .dx ?? 0 ) - 100 ;
69
69
70
70
return PageStorage (
71
71
bucket: pageStorageBucket,
72
72
child: Positioned (
73
- left: horizontalOverflow ? leftOffsetLimit : widget.normalOffset.dx,
73
+ left: isHorizontalOverflowed ? leftOffsetLimit : widget.normalOffset.dx,
74
74
top: verticalFlipRequired
75
75
? widget.flippedOffset.dy
76
76
: widget.normalOffset.dy,
@@ -120,6 +120,13 @@ class PopupState extends State<Popup> {
120
120
return isPopupOverflowingHeight && isPopupShorterThanWindow;
121
121
}
122
122
123
+ bool _isHorizontallyOverflowed () {
124
+ return widget.normalOffset.dx -
125
+ (widget.editorOffset? .dx ?? 0 ) +
126
+ Sizes .autocompletePopupMaxWidth >
127
+ widget.editingWindowSize.width;
128
+ }
129
+
123
130
Widget _buildListItem (int index) {
124
131
return Material (
125
132
color: Colors .grey.withOpacity (0.1 ),
0 commit comments