Fake slow submitting form

When the form is not submitted using Ajax but you want to make it seem like it is using ajax, you can give a loading state to the last clicked button.

This component mimics Button with ajax-loading state for forms that don't use Ajax. So instead of the button going back to a normal state after click, the browser will go to a new page.

When clicking the submit button, a new webpage will start loading, but before the browser refreshes / redirects the page, the button will be in loading state.

Enabling on a form

To enable this behaviour on a form, you will need to add the class form--slow-submitter to the form. and attach the library:

{{ attach_library('compony/form--slow-submitter') }}

 

Specifications

Machine name

form--slow-submitter

Perks

Using Sass
Responsive
Accessible

Building blocks

HTML
CSS

Stats

Public component
16 downloads
No open issue

Contributors