TF-3114 Hide rich text button when focusing on Name/Bcc to text input

This commit is contained in:
dab246
2024-09-09 16:54:19 +07:00
committed by Dat H. Pham
parent 0d4c266300
commit 7f16d92f19
@@ -167,6 +167,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
log('IdentityCreatorController::onInit():arguments: ${Get.arguments}'); log('IdentityCreatorController::onInit():arguments: ${Get.arguments}');
arguments = Get.arguments; arguments = Get.arguments;
_beforeReconnectManager.addListener(onBeforeReconnect); _beforeReconnectManager.addListener(onBeforeReconnect);
_initFocusListener();
} }
@override @override
@@ -192,6 +193,28 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
} }
} }
void _initFocusListener() {
inputNameIdentityFocusNode.addListener(_onInputNameIdentityListener);
inputBccIdentityFocusNode.addListener(_onInputBccIdentityListener);
}
void _removeFocusListener() {
inputNameIdentityFocusNode.removeListener(_onInputNameIdentityListener);
inputBccIdentityFocusNode.removeListener(_onInputBccIdentityListener);
}
void _onInputNameIdentityListener() {
if (inputNameIdentityFocusNode.hasFocus && PlatformInfo.isMobile) {
richTextMobileTabletController?.richTextController.hideRichTextView();
}
}
void _onInputBccIdentityListener() {
if (inputBccIdentityFocusNode.hasFocus && PlatformInfo.isMobile) {
richTextMobileTabletController?.richTextController.hideRichTextView();
}
}
void _checkPublicAssetCapability() { void _checkPublicAssetCapability() {
if (CapabilityIdentifier.jmapPublicAsset.isSupported(session!, accountId!)) { if (CapabilityIdentifier.jmapPublicAsset.isSupported(session!, accountId!)) {
PublicAssetBindings(PublicAssetArguments(session!, accountId!, identity: identity)).dependencies(); PublicAssetBindings(PublicAssetArguments(session!, accountId!, identity: identity)).dependencies();
@@ -243,6 +266,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
void onClose() { void onClose() {
log('IdentityCreatorController::onClose():'); log('IdentityCreatorController::onClose():');
isLoadSignatureCompleted = false; isLoadSignatureCompleted = false;
_removeFocusListener();
inputNameIdentityFocusNode.dispose(); inputNameIdentityFocusNode.dispose();
inputBccIdentityFocusNode.dispose(); inputBccIdentityFocusNode.dispose();
inputNameIdentityController.dispose(); inputNameIdentityController.dispose();