chore: fix can't delete characters in card (#5562)

* chore: fix can't delete characters in card

* chore: i18n
This commit is contained in:
Nathan.fooo 2024-06-18 13:12:57 +08:00 committed by GitHub
parent 3e75f1f24a
commit a05ed63a3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View File

@ -464,7 +464,7 @@ class _BoardColumnFooterState extends State<BoardColumnFooter> {
const SingleActivator(LogicalKeyboardKey.keyE): nada,
const SingleActivator(LogicalKeyboardKey.keyN): nada,
const SingleActivator(LogicalKeyboardKey.delete): nada,
const SingleActivator(LogicalKeyboardKey.backspace): nada,
// const SingleActivator(LogicalKeyboardKey.backspace): nada,
const SingleActivator(LogicalKeyboardKey.enter): nada,
const SingleActivator(LogicalKeyboardKey.numpadEnter): nada,
const SingleActivator(LogicalKeyboardKey.comma): nada,
@ -610,7 +610,7 @@ class _BoardCardState extends State<_BoardCard> {
const SingleActivator(LogicalKeyboardKey.keyE): nada,
const SingleActivator(LogicalKeyboardKey.keyN): nada,
const SingleActivator(LogicalKeyboardKey.delete): nada,
const SingleActivator(LogicalKeyboardKey.backspace): nada,
// const SingleActivator(LogicalKeyboardKey.backspace): nada,
const SingleActivator(LogicalKeyboardKey.enter): nada,
const SingleActivator(LogicalKeyboardKey.numpadEnter): nada,
const SingleActivator(LogicalKeyboardKey.comma): nada,

View File

@ -1,8 +1,11 @@
import 'dart:io';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database/board/application/board_actions_bloc.dart';
import 'package:appflowy/plugins/database/board/application/board_bloc.dart';
import 'package:appflowy/plugins/shared/callback_shortcuts.dart';
import 'package:appflowy/workspace/presentation/widgets/dialogs.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -147,7 +150,14 @@ class BoardShortcutContainer extends StatelessWidget {
if (focusScope.value.length != 1) {
return false;
}
context.read<BoardBloc>().add(BoardEvent.deleteCards(focusScope.value));
NavigatorOkCancelDialog(
message: LocaleKeys.grid_row_deleteCardPrompt.tr(),
onOkPressed: () {
context.read<BoardBloc>().add(BoardEvent.deleteCards(focusScope.value));
},
).show(context);
return true;
}

View File

@ -1092,6 +1092,7 @@
"add": "Click add to below",
"drag": "Drag to move",
"deleteRowPrompt": "Are you sure you want to delete this row? This action cannot be undone",
"deleteCardPrompt": "Are you sure you want to delete this card? This action cannot be undone",
"dragAndClick": "Drag to move, click to open menu",
"insertRecordAbove": "Insert record above",
"insertRecordBelow": "Insert record below",
@ -1925,4 +1926,4 @@
"upgradeYourSpace": "Create multiple Spaces",
"quicklySwitch": "Quickly switch to the next space"
}
}
}