You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the AutocompleteCombobox class, the handle_keyrelease method currently checks for the length of event.keysym to determine if autocomplete should be triggered. This check fails for Cyrillic characters, as their keysym has a length of 2, resulting in the autocomplete feature not functioning for these characters.
For the Cyrillic character "г", len(event.keysym) = 2
For the Latin character "g", len(event.keysym) = 1
Proposed Solution:
Update the handle_keyrelease method to allow for the autocomplete feature to be triggered for all character inputs, not just those with a keysym length of 1. The following implementation has been suggested:
importtkinterastkfromttkwidgets.autocompleteimportAutocompleteComboboxclassCustomAutocompleteCombobox(AutocompleteCombobox):
defhandle_keyrelease(self, event):
ifevent.keysym=="BackSpace":
self.delete(self.index(tk.INSERT), tk.END)
self.position=self.index(tk.END)
elifevent.keysym=="Left":
ifself.position<self.index(tk.END):
self.delete(self.position, tk.END)
else:
self.position-=1self.delete(self.position, tk.END)
elifevent.keysym=="Right":
self.position=self.index(tk.END)
elifevent.keysym=="Return":
self.handle_return(event)
returnelse:
# Call autocomplete for all other keysself.autocomplete()
Expected Outcome:
With this change, the autocomplete feature should work correctly for both Cyrillic and Latin characters, providing a more user-friendly experience.
The text was updated successfully, but these errors were encountered:
Description:
In the
AutocompleteCombobox
class, thehandle_keyrelease
method currently checks for the length ofevent.keysym
to determine if autocomplete should be triggered. This check fails for Cyrillic characters, as theirkeysym
has a length of 2, resulting in the autocomplete feature not functioning for these characters.Current Implementation:
Example:
len(event.keysym) = 2
len(event.keysym) = 1
Proposed Solution:
Update the
handle_keyrelease
method to allow for the autocomplete feature to be triggered for all character inputs, not just those with akeysym
length of 1. The following implementation has been suggested:Expected Outcome:
With this change, the autocomplete feature should work correctly for both Cyrillic and Latin characters, providing a more user-friendly experience.
The text was updated successfully, but these errors were encountered: