Skip to content

Commit d7097c6

Browse files
authored
Fix FTextField applying different padding across platforms & popover dismissal behavior in date/time fields (#620)
* Change default select alignment * Fix `FTextField` applying different padding on mobile & desktop. * Improves popover dismissal behavior in date/time fields * Prepare Forui for review * Fix typos * Fix failing test * Update windows-latest goldens --------- Co-authored-by: Pante <[email protected]>
1 parent 48de227 commit d7097c6

File tree

506 files changed

+115
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

506 files changed

+115
-16
lines changed

forui/CHANGELOG.md

Lines changed: 8 additions & 0 deletions

forui/README.md

Lines changed: 3 additions & 1 deletion

forui/bin/commands/style/style.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

forui/lib/src/widgets/date_field/calendar/calendar_date_field.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class _CalendarDateField extends FDateField implements FDateFieldCalendarPropert
5151
this.spacing = const FPortalSpacing(4),
5252
this.shift = FPortalShift.flip,
5353
this.offset = Offset.zero,
54-
this.hideOnTapOutside = FHidePopoverRegion.anywhere,
54+
this.hideOnTapOutside = FHidePopoverRegion.excludeTarget,
5555
this.dayBuilder = FCalendar.defaultDayBuilder,
5656
this.start,
5757
this.end,

forui/lib/src/widgets/date_field/calendar/properties.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ class FDateFieldCalendarProperties with Diagnosticable {
2121
final Offset offset;
2222

2323
/// {@macro forui.widgets.FPopover.hideOnTapOutside}
24+
///
25+
/// Defaults to [FHidePopoverRegion.excludeTarget].
26+
///
27+
/// Setting [hideOnTapOutside] to [FHidePopoverRegion.anywhere] may result in the calendar disappearing and reappearing
28+
/// when pressing and holding the input field, due to the popover being hidden and then immediately shown again.
2429
final FHidePopoverRegion hideOnTapOutside;
2530

2631
/// Customizes the appearance of calendar days.

forui/lib/src/widgets/date_field/date_field.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ abstract class FDateField extends StatefulWidget {
350350
/// The [offset] property controls the offset of the picker popover. Defaults to [Offset.zero].
351351
///
352352
/// [hideOnTapOutside] controls the region that can be tapped to hide the popover. Defaults to
353-
/// [FHidePopoverRegion.anywhere].
353+
/// [FHidePopoverRegion.excludeTarget].
354354
///
355355
/// See also:
356356
/// * [FDateField] - Creates a date field with both input field and calendar.

forui/lib/src/widgets/select/select_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class FSelectController<T> extends FValueNotifier<T?> {
5959
required TickerProvider vsync,
6060
T? value,
6161
this.toggleable = false,
62-
Duration popoverAnimationDuration = const Duration(milliseconds: 50),
62+
Duration popoverAnimationDuration = const Duration(milliseconds: 100),
6363
}) : popover = FPopoverController(vsync: vsync, animationDuration: popoverAnimationDuration),
6464
super(value);
6565

File renamed without changes.
File renamed without changes.

forui/lib/src/widgets/select/select.dart renamed to forui/lib/src/widgets/select/single/select.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ abstract class FSelect<T> extends StatefulWidget with FFormFieldProperties<T> {
145145
/// True if a clear button should be shown. Defaults to false.
146146
final bool clearable;
147147

148-
/// The alignment point on the popover. Defaults to [Alignment.topLeft].
148+
/// The alignment point on the popover. Defaults to [AlignmentDirectional.topStart].
149149
final AlignmentGeometry anchor;
150150

151-
/// The alignment point on the select's field. Defaults to [Alignment.bottomLeft].
151+
/// The alignment point on the select's field. Defaults to [AlignmentDirectional.bottomStart].
152152
final AlignmentGeometry fieldAnchor;
153153

154154
/// The constraints to apply to the popover. Defaults to `const FAutoWidthPortalConstraints(maxHeight: 300)`.
@@ -266,8 +266,8 @@ abstract class FSelect<T> extends StatefulWidget with FFormFieldProperties<T> {
266266
MouseCursor mouseCursor = SystemMouseCursors.click,
267267
bool canRequestFocus = true,
268268
bool clearable = false,
269-
AlignmentGeometry anchor = Alignment.topLeft,
270-
AlignmentGeometry fieldAnchor = Alignment.bottomLeft,
269+
AlignmentGeometry anchor = AlignmentDirectional.topStart,
270+
AlignmentGeometry fieldAnchor = AlignmentDirectional.bottomStart,
271271
FPortalConstraints popoverConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
272272
FPortalSpacing spacing = const FPortalSpacing(4),
273273
Offset Function(Size, FPortalChildBox, FPortalBox) shift = FPortalShift.flip,
@@ -428,8 +428,8 @@ abstract class FSelect<T> extends StatefulWidget with FFormFieldProperties<T> {
428428
MouseCursor mouseCursor = SystemMouseCursors.click,
429429
bool canRequestFocus = true,
430430
bool clearable = false,
431-
AlignmentGeometry anchor = Alignment.topLeft,
432-
AlignmentGeometry fieldAnchor = Alignment.bottomLeft,
431+
AlignmentGeometry anchor = AlignmentDirectional.topStart,
432+
AlignmentGeometry fieldAnchor = AlignmentDirectional.bottomStart,
433433
FPortalConstraints popoverConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
434434
FPortalSpacing spacing = const FPortalSpacing(4),
435435
Offset Function(Size, FPortalChildBox, FPortalBox) shift = FPortalShift.flip,
@@ -525,8 +525,8 @@ abstract class FSelect<T> extends StatefulWidget with FFormFieldProperties<T> {
525525
this.mouseCursor = SystemMouseCursors.click,
526526
this.canRequestFocus = true,
527527
this.clearable = false,
528-
this.anchor = Alignment.topLeft,
529-
this.fieldAnchor = Alignment.bottomLeft,
528+
this.anchor = AlignmentDirectional.topStart,
529+
this.fieldAnchor = AlignmentDirectional.bottomStart,
530530
this.popoverConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
531531
this.spacing = const FPortalSpacing(4),
532532
this.shift = FPortalShift.flip,

0 commit comments

Comments
 (0)