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

Consider removing no-js device from Blacklight #2850

Open
jrochkind opened this issue Oct 20, 2022 · 1 comment
Open

Consider removing no-js device from Blacklight #2850

jrochkind opened this issue Oct 20, 2022 · 1 comment

Comments

@jrochkind
Copy link
Member

Blacklight has a mechanism meant to support non-javascript degradation, where the body tag has a no-js class, which is removed by javascript on page load.

However, as far as I can tell the only place it is used is with rendering of the sort and/per-page widgets. The only reference I can find to no-js is here:

.no-js .sort-pagination {
& {
@extend .clearfix;
}
.dropdown-menu {
background: none;
box-shadow: none;
border: none;
position: relative;
display: block;
float: none;
}

And it doesn't actually work properly there. Could we actually remove it from Blacklight, one less thing to maintain/that can go wrong?

the sort and per-page widgets

Here's what they actually currently look like with javascript disabled:

Screen Shot 2022-10-20 at 3 17 52 PM

You can click on those menu options to change sort and per-page choices -- that works, but they are not showing up properly, they're on top of other content. Those giant "sort by relevance" and "10 per page" boxes are not click-able, and are also generally messing up the page.

There are other parts of Blacklight that do not have non-JS fallbacks -- the facet menus are not accessible at all without JS.

If you do have javascript turned on, and have bootstrap JS loaded, but do NOT have blacklight JS loaded, the current situation leaves the sort and per-page options displaying all weird because of the special no-js styling. So this just makes things generally more fragile -- you wouldn't ordinarily have needed the BL JS at all maybe, but find yourself confused as to why it seems to be required to make these elements styled correctly. This is where I found myself, that led me to investigate this, and make this proposal.

Propose...

Just remove the no-js mechanism. It is no longer used anywhere but sort-pagination, and does not work properly there.

sort-pagination could be fixed to work with a no-JS fallback (perhaps using a mechanism other than body.no-js -- but the rest of Blacklight no longer always works with no js at all either, for instance facets do not. This seems to be a pattern/appraoch which is no longer used in BL, and which is only holding on in unmaintained and not working fashion for sort-pagination.

So I propose simply removing it.

@jrochkind
Copy link
Member Author

Another bad effect: In the sort/pagination area, this results in a flash of badly styled content before JS is loaded, and a page reflow with content moving around the page once JS is loaded (and removes the no-js class) -- on a slow network, this can be more visible.

jrochkind added a commit that referenced this issue Nov 15, 2022
It has been not used, and not working where it is used, for some time. Remove non-effective approach. ref #2850
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

No branches or pull requests

1 participant