swup / fragment-plugin

A swup plugin for dynamically replacing containers based on rules 🧩
https://swup-fragment-plugin.netlify.app
MIT License
15 stars 1 forks source link

Feature/a11y focus #43

Closed hirasso closed 1 year ago

hirasso commented 1 year ago

Closes #42

Description

Allows to customize the focus for a visit per fragment rule, if Accessibility Plugin is installed.

This will not move the focus at all:

{
  focus: false
}

Exception: If the currently focused element will be replaced during the visit, the focus will automatically be moved to the body by the browser.

This will move the focus to the first element matching #my-element:

{
  focus: '#my-element'
}

Checks

daun commented 1 year ago

Looking great! 🍾 Just found a tiny typo, added a comment.