TF-4011 Support Tab shortcut key to switch focus between tag & input field
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -134,6 +134,9 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_currentListEmailAddress = widget.listEmailAddress;
|
||||
if (PlatformInfo.isWeb) {
|
||||
widget.focusNodeKeyboard?.addListener(_onFocusKeyboardListener);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -144,6 +147,20 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (PlatformInfo.isWeb) {
|
||||
widget.focusNodeKeyboard?.removeListener(_onFocusKeyboardListener);
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _onFocusKeyboardListener() {
|
||||
if (widget.focusNodeKeyboard?.hasFocus != true && mounted) {
|
||||
setState(() => _tagIndexFocused = -1);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool isMobileResponsive = _responsiveUtils.isMobile(context);
|
||||
@@ -406,7 +423,9 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
|
||||
}
|
||||
|
||||
KeyEventResult _recipientInputOnKeyListener(FocusNode node, KeyEvent event) {
|
||||
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.tab) {
|
||||
if (widget.focusNode?.hasFocus == true &&
|
||||
event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.tab) {
|
||||
widget.nextFocusNode?.requestFocus();
|
||||
widget.onFocusNextAddressAction?.call();
|
||||
return KeyEventResult.handled;
|
||||
|
||||
+2
-2
@@ -2170,10 +2170,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: super_tag_editor
|
||||
sha256: "83823674fa1048eb0411d169c9072028fa80ba6998ef18b357c29f58b835ea75"
|
||||
sha256: "7f7c1cb38e98e9cfa92fb074d4d5f5f53846d6bffcc96e05cb2191c159dba28d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.1"
|
||||
version: "1.1.0"
|
||||
syncfusion_flutter_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ dependencies:
|
||||
ref: master
|
||||
|
||||
### Dependencies from pub.dev ###
|
||||
super_tag_editor: 0.4.1
|
||||
super_tag_editor: 1.1.0
|
||||
|
||||
external_app_launcher: 4.0.3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user