Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete - Bug or limitation? #54

Open
Demsli opened this issue Nov 1, 2024 · 1 comment
Open

Autocomplete - Bug or limitation? #54

Demsli opened this issue Nov 1, 2024 · 1 comment

Comments

@Demsli
Copy link

Demsli commented Nov 1, 2024

I am testing the autocomplete feature on CTKComboBox. Noticed that when I start typing the name - it only includes values that start with this name. The list of values is ["Great Britain", "British Isles", "Dialect British"]. So I started typing "Brit" and was expecting all three values to comeup. Yet got the only one - British Isles. Is it a bug or some limitation? Can it be the issue with the fact that I am taking values from google sheet names? The code is written like so:
self.sheet_name_prettified = CTkScrollableDropdown(attach=self.sheet_name, values=[worksheet.title for worksheet in self.spreadsheet.worksheets()], fg_color=('white', '#1D1E21'), text_color=('black', 'white'), button_color=('white', '#1D1E21'), hover='disabled', width=200, justify='center', autocomplete=True)

Will be glad to hear any tipps how to fix it. Thanks in advance:)

@Demsli
Copy link
Author

Demsli commented Nov 1, 2024

Found the fix. def live_update in ctk_scrollable_dropdown.py had a variable similar that was written like this:
similar = s.startswith(string) or text_similarity > 0.75
Changing it to this improved searching:
similar = string in s or text_similarity > 0.75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant