Refactor the check for the type of the root element in GOVUKFrontendComponent
#5326
Closed
2 tasks
Milestone
What
Refactor the check for the type of component's root element to
GOVUKFrontendComponent
.By default, this will check against
HTMLElement
, but SkipLink will need to check againstHTMLAnchorElement
so component classes will need to be able to define the type of their root element in a static property (rootElementType
,rootType
orrootClass
, name to be decided as part of this piece of work).This may have impact on typing (the
$root
element type will need to match therootElementType
when accessed from the child class) so first step will be to run a quick spike of the change to assess the impact on that side.Why
As a first step, all components check that the root element that was passed to them is of the expected type. This can be factored in the base class.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
GOVUKFrontendComponent
The text was updated successfully, but these errors were encountered: