Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the check for the type of the root element in GOVUKFrontendComponent #5326

Closed
2 tasks
Tracked by #5373 ...
romaricpascal opened this issue Sep 16, 2024 · 0 comments
Closed
2 tasks
Tracked by #5373 ...
Assignees
Milestone

Comments

@romaricpascal
Copy link
Member

romaricpascal commented Sep 16, 2024

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 against HTMLAnchorElement so component classes will need to be able to define the type of their root element in a static property (rootElementType, rootType or rootClass, 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 the rootElementType 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

  • A spike has been do to assess the impact of the refactoring on types
  • If we go ahead, the check for the element type has been moved to GOVUKFrontendComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants