Skip to content

Conversation

@polka125
Copy link

Hi! This PR fixes the bug described here: zotero/zotero#4972

The bug: when the search field contains one character, the "enter" button does not trigger a new search. Moreover, if the field value was obtained as a result of letter deletion (for example, the first search was 'tr', the second search was: 't'), the search is performed on the old value ('tr').

The bug is expalined by the debouncing behaviour, and how the seach keyword is passed to the search engine. The solution is: whenever a key combination is triggered, we must distinguish two situations

  1. the seach field changed, so we must start a fresh search for the case of enter or shift+enter
  2. the seach field did not change, so we can call the findNext or findPrevious

Visual testing:

  1. before
reader-before-fix-shrink.mp4
  1. after
reader-after-fix-shrink.mp4

@polka125
Copy link
Author

Hello, just wanted to know if I can improve this PR somehow, or what's wrong with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant