Переглянути джерело

fix(picker): disable snap to items (default) to center selection in picker

ayn2op 2 місяців тому
батько
коміт
7af199b5a3
1 змінених файлів з 3 додано та 5 видалено
  1. 3 5
      pkg/picker/picker.go

+ 3 - 5
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