TF-3082 Fix identity dialog auto scroll after picking image
This commit is contained in:
@@ -117,6 +117,13 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
final GlobalKey htmlKey = GlobalKey();
|
final GlobalKey htmlKey = GlobalKey();
|
||||||
final htmlEditorMinHeight = 150;
|
final htmlEditorMinHeight = 150;
|
||||||
bool isLoadSignatureCompleted = false;
|
bool isLoadSignatureCompleted = false;
|
||||||
|
bool _userScrolled = false;
|
||||||
|
|
||||||
|
void _scrollListener() {
|
||||||
|
if (!_userScrolled) {
|
||||||
|
_userScrolled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void updateNameIdentity(BuildContext context, String? value) {
|
void updateNameIdentity(BuildContext context, String? value) {
|
||||||
_nameIdentity = value?.trim();
|
_nameIdentity = value?.trim();
|
||||||
@@ -166,6 +173,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
log('IdentityCreatorController::onReady():');
|
log('IdentityCreatorController::onReady():');
|
||||||
|
scrollController.addListener(_scrollListener);
|
||||||
if (arguments != null) {
|
if (arguments != null) {
|
||||||
accountId = arguments!.accountId;
|
accountId = arguments!.accountId;
|
||||||
session = arguments!.session;
|
session = arguments!.session;
|
||||||
@@ -239,6 +247,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
inputBccIdentityFocusNode.dispose();
|
inputBccIdentityFocusNode.dispose();
|
||||||
inputNameIdentityController.dispose();
|
inputNameIdentityController.dispose();
|
||||||
inputBccIdentityController.dispose();
|
inputBccIdentityController.dispose();
|
||||||
|
scrollController.removeListener(_scrollListener);
|
||||||
scrollController.dispose();
|
scrollController.dispose();
|
||||||
if (PlatformInfo.isWeb) {
|
if (PlatformInfo.isWeb) {
|
||||||
richTextWebController?.onClose();
|
richTextWebController?.onClose();
|
||||||
@@ -803,6 +812,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
|
|
||||||
void onLoadSignatureCompleted(String? content) {
|
void onLoadSignatureCompleted(String? content) {
|
||||||
isLoadSignatureCompleted = true;
|
isLoadSignatureCompleted = true;
|
||||||
|
if (_userScrolled) return;
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||||
if (scrollController.hasClients) {
|
if (scrollController.hasClients) {
|
||||||
scrollController.animateTo(
|
scrollController.animateTo(
|
||||||
|
|||||||
Reference in New Issue
Block a user