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

🐛 fix(search): restore highlighting functionality #401

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

welpo
Copy link
Owner

@welpo welpo commented Sep 24, 2024

Summary

Fixes a bug where the search results would no longer be highlighted unless using keyboard. Restores the previous functionality where the first result is auto-selected/highlighted, and mouse hovering highlights the relevant search result.

Related issue

Bug introduced in #388.

Changes

  • Modified the event listener for the search input to avoid shadowing the global searchInput variable.
  • Renamed the local searchInput variable to inputValue within the event listener function.
  • Ensured that all references to searchInput now correctly point to the DOM element, allowing methods like setAttribute to function properly.

Type of change

  • Bug fix (fixes an issue without altering functionality)
  • New feature (adds non-breaking functionality)
  • Breaking change (alters existing functionality)
  • UI/UX improvement (enhances user interface without altering functionality)
  • Refactor (improves code quality without altering functionality)
  • Documentation update
  • Other (please describe below)

Checklist

  • I have verified the accessibility of my changes
  • I have tested all possible scenarios for this change
  • I have updated theme.toml with a sane default for the feature
  • I have made corresponding changes to the documentation:
    • Updated config.toml comments
    • Updated theme.toml comments
    • Updated "Mastering tabi" post in English
    • (Optional) Updated "Mastering tabi" post in Spanish
    • (Optional) Updated "Mastering tabi" post in Catalan

Broke in #388.

- Rename local searchInput variable to inputValue
- Preserve global searchInput DOM element reference
@welpo welpo added the bug Something isn't working label Sep 24, 2024
Copy link

netlify bot commented Sep 24, 2024

Deploy Preview for tabi-demo ready!

Name Link
🔨 Latest commit 3100730
🔍 Latest deploy log https://app.netlify.com/sites/tabi-demo/deploys/66f2f366f31ea00008aa7767
😎 Deploy Preview https://deploy-preview-401--tabi-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@welpo welpo merged commit 17694ba into main Sep 24, 2024
7 checks passed
@welpo welpo deleted the fix/search-input-shadowing branch September 24, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant