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.

fix: select field type option editor overflow (#4188)

Richard Shiue0730a0caf47c
diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/grid/presentation/widgets/header/field_editor.dart b/frontend/appflowy_flutter/lib/plugins/database_view/grid/presentation/widgets/header/field_editor.dart
index 1c0ba0946c..bafd022295 100644
--- a/frontend/appflowy_flutter/lib/plugins/database_view/grid/presentation/widgets/header/field_editor.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database_view/grid/presentation/widgets/header/field_editor.dart
@@ -331,7 +331,12 @@ class _FieldDetailsEditorState extends State<FieldDetailsEditor> {
const VSpace(8.0),
SwitchFieldButton(popoverMutex: popoverMutex),
const TypeOptionSeparator(spacing: 8.0),
- FieldTypeOptionEditor(viewId: widget.viewId, popoverMutex: popoverMutex),
+ Flexible(
+ child: FieldTypeOptionEditor(
+ viewId: widget.viewId,
+ popoverMutex: popoverMutex,
+ ),
+ ),
_addFieldVisibilityToggleButton(),
_addDuplicateFieldButton(),
_addDeleteFieldButton(),
@@ -437,7 +442,7 @@ class FieldTypeOptionEditor extends StatelessWidget {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
- typeOptionEditor,
+ Flexible(child: typeOptionEditor),
const TypeOptionSeparator(spacing: 8.0),
],
);
diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/grid/presentation/widgets/header/type_option/select/select_option.dart b/frontend/appflowy_flutter/lib/plugins/database_view/grid/presentation/widgets/header/type_option/select/select_option.dart
index 518c9a63f4..ad3f1e039a 100644
--- a/frontend/appflowy_flutter/lib/plugins/database_view/grid/presentation/widgets/header/type_option/select/select_option.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database_view/grid/presentation/widgets/header/type_option/select/select_option.dart
@@ -45,11 +45,16 @@ class SelectOptionTypeOptionWidget extends StatelessWidget {
] else
const _AddOptionButton(),
const VSpace(4),
- _OptionList(popoverMutex: popoverMutex),
+ ...state.options.map((option) {
+ return _OptionCell(
+ option: option,
+ popoverMutex: popoverMutex,
+ );
+ }),
];
- return Column(
- mainAxisSize: MainAxisSize.min,
+ return ListView(
+ shrinkWrap: true,
children: children,
);
},
@@ -81,39 +86,6 @@ class _OptionTitle extends StatelessWidget {
}
}
-class _OptionList extends StatelessWidget {
- final PopoverMutex? popoverMutex;
- const _OptionList({this.popoverMutex});
-
- @override
- Widget build(BuildContext context) {
- return BlocBuilder<SelectOptionTypeOptionBloc, SelectOptionTypeOptionState>(
- buildWhen: (previous, current) {
- return previous.options != current.options;
- },
- builder: (context, state) {
- final cells = state.options.map((option) {
- return _OptionCell(
- option: option,
- popoverMutex: popoverMutex,
- );
- }).toList();
-
- return ListView.separated(
- shrinkWrap: true,
- separatorBuilder: (context, index) {
- return VSpace(GridSize.typeOptionSeparatorHeight);
- },
- itemCount: cells.length,
- itemBuilder: (BuildContext context, int index) {
- return cells[index];
- },
- );
- },
- );
- }
-}
-
class _OptionCell extends StatefulWidget {
final SelectOptionPB option;
final PopoverMutex? popoverMutex;