Harden phone entry click state
This commit is contained in:
@@ -645,13 +645,21 @@ func (u *ui) filter() {
|
||||
return
|
||||
}
|
||||
u.visible = visible
|
||||
if len(u.entryClicks) < len(u.visible) {
|
||||
u.entryClicks = make([]widget.Clickable, len(u.visible))
|
||||
u.ensureEntryClicks()
|
||||
}
|
||||
|
||||
func (u *ui) ensureEntryClicks() {
|
||||
if len(u.entryClicks) >= len(u.visible) {
|
||||
return
|
||||
}
|
||||
next := make([]widget.Clickable, len(u.visible))
|
||||
copy(next, u.entryClicks)
|
||||
u.entryClicks = next
|
||||
}
|
||||
|
||||
func (u *ui) visibleEntrySnapshot() ([]entry, []*widget.Clickable) {
|
||||
visible := append([]entry(nil), u.visible...)
|
||||
u.ensureEntryClicks()
|
||||
clicks := make([]*widget.Clickable, len(visible))
|
||||
for i := range visible {
|
||||
clicks[i] = &u.entryClicks[i]
|
||||
|
||||
Reference in New Issue
Block a user