Skip to content

Commit

Permalink
scroll keyboard when selection editors on send page
Browse files Browse the repository at this point in the history
  • Loading branch information
dreacot committed Sep 26, 2024
1 parent 04c7037 commit c3b8c62
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ui/page/send/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit c3b8c62

Please sign in to comment.