From 4be836289a746c3bb726b1cdb0779da62ecc20e9 Mon Sep 17 00:00:00 2001 From: dreacot Date: Thu, 26 Sep 2024 19:44:25 +0100 Subject: [PATCH] scroll keyboard when selection editors on send page --- ui/page/send/page.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ui/page/send/page.go b/ui/page/send/page.go index 5d0e3d4f4..00710facb 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,24 @@ func (pg *Page) HandleUserInteractions(gtx C) { } // handle recipient user interactions + // TODO: Automatically calculate ScrollTo position for _, re := range pg.recipients { re.HandleUserInteractions(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(1) + if pg.IsMobileView() { + pg.pageContainer.List.ScrollTo(3) + } + } + if re.description.Pressed(gtx) { + pg.pageContainer.List.ScrollTo(3) + } } }