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

Have search boxes update on right-click paste #935

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jaredkhan
Copy link
Collaborator

@jaredkhan jaredkhan commented Jan 1, 2025

Fixes #933

Previously. Only keyboard events were triggering search updates, so lots of ways of changing the text (including copy-paste on iPad) didn't trigger it.

Little refactor too so we even save 6 lines of code 😉

@jaredkhan jaredkhan requested a review from hyanwong January 4, 2025 16:24
Copy link
Contributor

@wolfmanstout wolfmanstout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I just added a couple suggestions to improve comments. I appreciate the small readability improvements you made!

trimmed_search_term.length > 2 ||
((trimmed_search_term.length > 1) && !should_delay)
) {
// never search for a single character
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this comment up before the if condition for readability.

@@ -100,45 +100,63 @@
</div>
<script>
(function() {
const update_search = (search_element, should_delay, debug_label) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks intentionally identical to the code in the other layout file. Please add a comment to each noting that these should stay in sync.

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.

Search box should load results on paste
2 participants