fix: cycle scroll when num_results is small (#316)
This commit is contained in:
@@ -696,11 +696,19 @@ end
|
|||||||
|
|
||||||
function Picker:_handle_scroll_strategy(row)
|
function Picker:_handle_scroll_strategy(row)
|
||||||
if self.scroll_strategy == "cycle" then
|
if self.scroll_strategy == "cycle" then
|
||||||
|
if self.max_results > self.manager:num_results() then
|
||||||
|
if row < self.max_results - self.manager:num_results() then
|
||||||
|
row = self.max_results - 1
|
||||||
|
elseif row > self.max_results - 1 then
|
||||||
|
row = self.max_results - self.manager:num_results()
|
||||||
|
end
|
||||||
|
else
|
||||||
if row >= self.max_results then
|
if row >= self.max_results then
|
||||||
row = 0
|
row = 0
|
||||||
elseif row < 0 then
|
elseif row < 0 then
|
||||||
row = self.max_results - 1
|
row = self.max_results - 1
|
||||||
end
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if row >= self.max_results then
|
if row >= self.max_results then
|
||||||
row = self.max_results - 1
|
row = self.max_results - 1
|
||||||
|
|||||||
Reference in New Issue
Block a user