swup / docs

Official swup documentation 📘
https://swup.js.org/getting-started
12 stars 35 forks source link

Add inline form demo #152

Closed daun closed 10 months ago

daun commented 10 months ago

Description

Checks

netlify[bot] commented 10 months ago

Deploy Preview for splendorous-kataifi-9ae281 ready!

Name Link
Latest commit ccc0ef990aac087a7c01f84ac533828a0ffd4e27
Latest deploy log https://app.netlify.com/sites/splendorous-kataifi-9ae281/deploys/650870b37e787a0008aea67a
Deploy Preview https://deploy-preview-152--splendorous-kataifi-9ae281.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.

hirasso commented 10 months ago

Nice! In the demo's text it says that the keyboard focus is being kept. Is this really the case? The form is being replaced after a click on submit, so the focus will go to the body, won't it?

daun commented 10 months ago

With the newest Forms Plugin update, we're using the id to build a selector, which should make this work. Let me double-check, though!

daun commented 10 months ago

It works. Phew 🥵 The wording is slightly wrong, then — the focus isn't kept but rather restored. For this intro text, I don't think it matters. What do you think?

hirasso commented 10 months ago

Ah ok now I understand! The focus will be moved to/kept on the submitted <form> element, right?

daun commented 10 months ago

Yes! With the current implementation, it will always (re-)focus the form itself, not keep the focus inside the form.