-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
docs: filter icons by URL search query #731
Conversation
Thanks for the PR! I should spend some time to move JS outside of HTML but that's for later. Not sure about Also, I feel like we might need a clear input button. EDIT: @korki43 actually I have already moved JS to https://github.com/twbs/icons/blob/main/docs/assets/js/application.js, so better move that there too (might need some extra checks to prevent TypeErrors etc). |
@XhmikosR thanks for the fast response! It seems like If I include list.js in vendor and add the other code to application.js both will be loaded on any page, although they're only needed on the homepage. I also could create a new folder (e.g. I also would suggest the name I also think it would be nice if the page automatically scrolls down to the icons if a search query is given. |
Can't you check for a specific selector and if not present bail out? I don't mind having a separate file, but I'd rather create a new "bundle" file with list.js and our needed code so that we can reuse it in the font page later. Perhaps, just leave it as is for now until we sort out #706 which will reuse the same logic as the homepage. As for scrolling, that would be a good idea. |
Of course it's possible to perform such a check, my concern was about the bundle size of We could also go with a different approach and use a "share" button to copy/share the search URL instead of a constantly updating url search query. It may be possible to use the Web Share API (or copy the link if it's not available). To implement the "scrolling" behavior, the I also think it's better to wait for #706. I will transform this into a draft PR. |
1b9f1a3
to
961697b
Compare
@korki43 You forgot about this? |
@vanillajonathan No, as per the comment above we are still waiting for #706 to be merged. |
Just merged #706! Took me long enough 😅 |
Unfortunately, we don't currently have a PR preview. I'll try to switch back to Netlify later. EDIT: Switched repo to Netlify, we should have PR previews back from outside collaborators. |
@korki43 could you please rebase one last time? |
I'm currently unable to work on my computer, but I will rebase the branch as soon as I get back. |
Take your time, thanks! BTW now I guess the right place would be https://github.com/twbs/icons/blob/main/docs/assets/js/list.js I plan to move the docs assets to modules and build them with Hugo like I do on the blog https://github.com/twbs/blog/tree/main/src/assets/js & https://github.com/twbs/blog/blob/main/src/layouts/partials/scripts.html |
Done. But I didn't know how to rebase and move the changes to another file so I just merged main into the branch and moved it manually. Preview: https://deploy-preview-731--bootstrap-icons.netlify.app/?q=circle |
8f431a7
to
128c153
Compare
This fixes #192.
It's currently not possible to get the search term via list.js so I took the search term directly from the input.
The url query will update whenever the search term changes.
Example: https://deploy-preview-731--bootstrap-icons.netlify.app/?q=brand