Problem/Motivation
The HTMX navigation of UI Suite UIkit uses a custom JavaScript file, assets/js/htmx-navigation.js, to keep full page loads for some links (administration, edit and delete pages, log out, Display Builder, files), to close the open UIkit overlays and to move the focus and announce the new page.
The same can be done with HTMX attributes rendered on the server, and with what UIkit and Drupal core HTMX already do, which is simpler to maintain.
Steps to reproduce
- Use UI Suite UIkit as the default theme, with the HTMX navigation enabled.
- Look at the libraries of a front-end page:
assets/js/htmx-navigation.jsis loaded.
Proposed resolution
- Render
hx-boost="false"on the links HTMX must not handle, from the theme hooks: menus, links, local tasks and actions, file links, image and link fields, and links in formatted text. - Rely on UIkit to close the offcanvas and dropdowns when HTMX swaps them, and keep the modal links out of the boosted navigation.
- Render
autofocuson the main content anchor for boosted requests, so HTMX moves the focus after the swap. - Announce the new page title in a polite live region updated with
hx-select-oob. - Remove
assets/js/htmx-navigation.jsand keep thecore/drupal.htmxdependency.
Remaining tasks
- ✅ File an issue about this project
- ❌ Addition/Change/Update/Fix to this project
- ❌ Testing to ensure no regression
- ❌ Automated unit/functional testing coverage
- ❌ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ UX/UI designer responsibilities
- ❌ Accessibility and Readability
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
User interface changes
None. The navigation works as before.
API changes
The Drupal.uiSuiteUikit.isExcludedFromHtmx() JavaScript function is removed.
Data model changes
None.
Issue fork ui_suite_uikit-3623015
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments