Repository navigation
Conversation
Debounce input-driven searches by 300 ms. A submission searches at once and cancels a search that still waits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #78.
Changes
actions.searchinsrc/taxonomy/view.jswaits 300 ms after aninputevent. It navigates only when no newer keystroke or submission arrived in that time. A submission searches at once and cancels a search that still waits. Clearing the field clears the search after the same pause.getContext()moves after the wait. The generator restores the directive scope after eachyield, so the call reads the context of the search block.tests/e2e/search-filter.spec.jstypes a word key by key and checks that the page requests only the full word. Without the fix, the test fails with one request for each character. A second test checks that a submission starts its request before the pause ends.Testing
npx playwright test: 54 passed.npx wp-scripts lint-js src/taxonomy/view.js tests/e2e/search-filter.spec.js: no errors.