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

Fixes logic for checking if user has typed ahead #264

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

dingfeli
Copy link
Contributor

Issue #, if available:
There is an existing logic to check if user has begun the typeahead. This is used by toggle suggestion to prevent users from toggling if they had already begun a typeahead.
This logic is currently off by one.
This PR changes the way this boolean is derived by checking when the function is invoked the difference between invocation offset and current offset (as opposed to relying on a stored state updated by the input listener).

Description of changes:

  • Changes the way this boolean is derived by checking when the function is invoked the difference between invocation offset and current offset (as opposed to relying on a stored state updated by the input listener).

Test:

  • Typeahead by one or more character
  • Try to toggle
  • Observe that toggle is disabled

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dingfeli dingfeli requested a review from breedloj November 22, 2024 00:43
@dingfeli dingfeli merged commit e201935 into main Nov 22, 2024
1 check passed
@dingfeli dingfeli deleted the fix-suggestion-toggle-enablement branch November 22, 2024 04:36
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

Successfully merging this pull request may close these issues.

2 participants