Skip to content

Commit

Permalink
refactor: replace deprecated mouse constants
Browse files Browse the repository at this point in the history
  • Loading branch information
kencx committed May 8, 2024
1 parent 0f8f75f commit d996d79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/list/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
if !m.viewport.MouseWheelEnabled {
break
}
switch msg.Type {
case tea.MouseWheelUp:
switch msg.Button {
case tea.MouseButtonWheelUp:
m.cursor -= m.viewport.MouseWheelDelta
if m.cursorPastViewTop() {
m.viewport.LineUp(m.viewport.MouseWheelDelta)
}
case tea.MouseWheelDown:
case tea.MouseButtonWheelDown:
m.cursor += m.viewport.MouseWheelDelta
if m.cursorPastViewBottom() {
m.viewport.LineDown(m.viewport.MouseWheelDelta)
Expand Down

0 comments on commit d996d79

Please sign in to comment.