You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The custom govuk_document_field defines a stimulus controller and actions to provide additional functionality over the default file field behaviour; however, we cannot (easily) amend this in a given form to include additional stimulus behaviour.
Use case
I want to use javascript to validate the size of a file before it is uploaded.
We can work around this limitation by inheriting from the original document field controller:
This only allows us to hook into existing actions, and not to define any custom behaviours, however.
Alternatively, we can use the base govuk_file_field; however, the trade-off is that we lose the additional functionality that Katalyst has invested in the file upload UX.
The text was updated successfully, but these errors were encountered:
The custom
govuk_document_field
defines a stimulus controller and actions to provide additional functionality over the default file field behaviour; however, we cannot (easily) amend this in a given form to include additional stimulus behaviour.Use case
I want to use javascript to validate the size of a file before it is uploaded.
We can work around this limitation by inheriting from the original document field controller:
This only allows us to hook into existing actions, and not to define any custom behaviours, however.
Alternatively, we can use the base
govuk_file_field
; however, the trade-off is that we lose the additional functionality that Katalyst has invested in the file upload UX.The text was updated successfully, but these errors were encountered: