Closed anentropic closed 1 year ago
Hi @anentropic, thanks for reporting the issue. I will investigate!
I have tested this with the following example under version 3.5.3
:
from beaupy import select_multiple
options = ["a", "b", "c", "d", "e", "f", "g", "h"]
ticked_indices = [2, 3, 4, 5]
indices = select_multiple(
options=options,
ticked_indices=ticked_indices,
cursor_index=ticked_indices[0],
minimal_count=1,
return_indices=True,
)
print(indices)
I've found a bug which manifests after pressing END
key, I am going to track that one down and hope it fixes your issue.
Before pressing END
:
Immediatelly after pressing END
:
I don't think I've pressed the END
key
Try with just ticked_indices = [5]
What I would see is the first option was ticked (I guess because index 5
would be first item of second page if paginated)
And then pressing space bar on items 6, 7 or 8 (index 5, 6, 7) would tick options 1, 2 or 3 (presumably index 0, 1, 2 of second page) and the other items not selectable
Right, this manifests for me also. Investigating in select_multiple
I am fairly convinced it is the symptom of the same bug. Nonetheless, I think I have found it, I've retried with your configuration and it now seems to work. I'll spend a bit of time adding some tests and then I should release 3.5.4
with a patch later today or tomorrow.
Thanks for cooperation on this!
Thanks, working for me now 👍
Currently if
len(options) > page_size
then the select list doesn't work properly - all items are shown but checks are misattributed to different options and some options are not selectablepagination=False
is the default, my code was like:(default page size is 5, I had 8 options)
I was able to work around it by setting
page_size=len(options),