From 7af199b5a302ded80a9707fd404075b6aa8741ae Mon Sep 17 00:00:00 2001 From: ayn2op Date: Sun, 8 Feb 2026 19:08:38 -0500 Subject: [PATCH] fix(picker): disable snap to items (default) to center selection in picker --- pkg/picker/picker.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/picker/picker.go b/pkg/picker/picker.go index dd2581f..860fd3e 100644 --- a/pkg/picker/picker.go +++ b/pkg/picker/picker.go @@ -32,11 +32,11 @@ func New() *Picker { } // Show a horizontal bottom border to visually separate input from list. - borderSet := tview.BorderSet{ - Bottom: tview.BoxDrawingsLightHorizontal, - } + var borderSet tview.BorderSet + borderSet.Bottom = tview.BoxDrawingsLightHorizontal borderSet.BottomLeft = borderSet.Bottom borderSet.BottomRight = borderSet.Bottom + p.input. SetChangedFunc(p.onInputChanged). SetLabel("> "). @@ -45,8 +45,6 @@ func New() *Picker { SetBorderStyle(tcell.StyleDefault.Dim(true)). SetInputCapture(p.onInputCapture) - p.list.SetSnapToItems(true) - p. SetDirection(tview.FlexRow). // bottom border + value