HTML element to use for button
Optional
config: ButtonConfig = {}Button config
Protected
_$rootPrivate
debounceStatic
Constant
defaultsButton default config
Static
elementStatic
moduleName for the component used when initialising using data-module attributes.
Static
Constant
schemaButton config schema
Protected
$rootProtected
Returns the root element of the component
Protected
configProtected
Returns the root element of the component
Internal
Virtual
configOverride
Function which defines configuration overrides to prioritize properties from the root element's dataset.
It should take a subset of configuration as input and return a new configuration object with properties that should be overridden based on the root element's dataset. A Symbol is used for indexing to prevent conflicts.
Optional
param: ObjectNestedConfiguration object
return - Configuration object
Private
debouncePrivate
Debounce double-clicks
If the click quickly succeeds a previous click then nothing will happen. This stops people accidentally causing multiple form submissions by double clicking buttons.
Mouse click event
Returns undefined, or false when debounced
Private
handlePrivate
Trigger a click event when the space key is pressed
Some screen readers tell users they can use the space bar to activate things with the 'button' role, so we need to match the functionality of native HTML buttons.
See https://github.com/alphagov/govuk_elements/pull/272#issuecomment-233028270
Keydown event
Static
check
JavaScript enhancements for the Button component