From 77bca152f74545dda4b593eece0119df9fe6dc2f Mon Sep 17 00:00:00 2001 From: dreacot Date: Thu, 26 Sep 2024 12:39:29 +0100 Subject: [PATCH] scroll keyboard when selection editors on send page --- ui/page/send/page.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ui/page/send/page.go b/ui/page/send/page.go index 5d0e3d4f4..ebadc723e 100644 --- a/ui/page/send/page.go +++ b/ui/page/send/page.go @@ -298,6 +298,12 @@ func (pg *Page) OnNavigatedTo() { // go load.GetAPIFeeRate(pg.selectedWallet) go pg.feeRateSelector.UpdatedFeeRate(pg.selectedWallet) } + + for _, re := range pg.recipients { // focus on destination address editor + re.sendDestination.destinationAddressEditor.SetFocus() + pg.pageContainer.List.ScrollTo(1) // scroll to the first item in the list + break + } } // OnDarkModeChanged is triggered whenever the dark mode setting is changed @@ -650,8 +656,22 @@ func (pg *Page) HandleUserInteractions(gtx C) { } // handle recipient user interactions + // TODO: Automatically calculate ScrollTo position for _, re := range pg.recipients { re.HandleUserInteractions(gtx) + re.handle(gtx) + if re.sendDestination.destinationAddressEditor.Pressed(gtx) { + pg.pageContainer.List.ScrollTo(1) + } + if re.amount.amountEditor.Pressed(gtx) { + pg.pageContainer.List.ScrollTo(1) + } + if re.amount.usdAmountEditor.Pressed(gtx) { + pg.pageContainer.List.ScrollTo(3) + } + if re.description.Pressed(gtx) { + pg.pageContainer.List.ScrollTo(3) + } } }