Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

feat: close popover on text field tap

Cyrine ben-abidb7f369b3d9c1
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart
index b2cf30faea..84e169d258 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart
@@ -10,6 +10,8 @@ class InputTextField extends StatefulWidget {
final void Function(String)? onChanged;
final void Function() onCanceled;
final void Function()? onFocused;
+ final void Function()? onTap;
+
final bool autoClearWhenDone;
final String text;
final int? maxLength;
@@ -20,6 +22,7 @@ class InputTextField extends StatefulWidget {
required this.onCanceled,
this.onChanged,
this.onFocused,
+ this.onTap,
this.autoClearWhenDone = false,
this.maxLength,
Key? key,
@@ -73,6 +76,11 @@ class _InputTextFieldState extends State<InputTextField> {
_controller.text = "";
}
},
+ onTap: () {
+ if (widget.onTap != null) {
+ widget.onTap!();
+ }
+ },
);
}
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart
index aabeca9646..f20d9460e1 100644
--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart
+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart
@@ -288,6 +288,9 @@ class _CreateOptionTextField extends StatelessWidget {
onFocused: () {
popoverMutex?.close();
},
+ onTap: () {
+ popoverMutex?.close();
+ },
);
},
);
diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart
index 9dec787c2e..becdfd8b06 100644
--- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart
+++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart
@@ -19,6 +19,7 @@ class RoundedInputField extends StatefulWidget {
final TextStyle style;
final ValueChanged<String>? onChanged;
final Function(String)? onEditingComplete;
+ final Function()? onTap;
final String? initialValue;
final EdgeInsets margin;
final EdgeInsets padding;
@@ -39,6 +40,7 @@ class RoundedInputField extends StatefulWidget {
this.obscureHideIcon,
this.onChanged,
this.onEditingComplete,
+ this.onTap,
this.normalBorderColor = Colors.transparent,
this.errorBorderColor = Colors.transparent,
this.focusBorderColor,
@@ -109,6 +111,11 @@ class _RoundedInputFieldState extends State<RoundedInputField> {
widget.onEditingComplete!(inputText);
}
},
+ onTap: () {
+ if (widget.onTap != null) {
+ widget.onTap!();
+ }
+ },
cursorColor: widget.cursorColor,
obscureText: obscuteText,
style: widget.style,