Skip to content

fix: Prevent an error if no sticky search button is used. #2055

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

notlee
Copy link
Contributor

@notlee notlee commented Mar 27, 2025

subs.ft.com heavily modifies the header. It uses a sticky header without search interface.

Generally we don't support this level of customisation for components, and would expect things could break in minor/patch releases without notice. I'd have recommended creating a custom component here from scratch. We might want to consider an Origami header component that centres a logo and allows for custom items left/right, but it's unlikely to make it on our roadmap soon. https://origami.ft.com/getting-started/customisation/

Despite that, this is a small issue, so let us be helpful and check for the presence of search and fail gracefully. We have recommended to pin to the patch release to reduce risk of future changes breaking unsupported customisations.

Closes: #2050

subs.ft.com heavily modifies the header. It uses a sticky header without search interface.

Generally we don't support this level of customisation for components, and would expect things could break in minor/patch releases without notice. I'd have recommended creating a custom component here from scratch. We might want to consider an Origami header component that centres a logo and allows for custom items left/right, but it's unlikely to make it on our roadmap soon.
https://origami.ft.com/getting-started/customisation/

Despite that, this is a small issue, so let us be helpful and check for the presence of search and fail gracefully. We have recommended to pin to the patch release to reduce risk of future changes breaking unsupported customisations.
@notlee notlee requested a review from a team as a code owner March 27, 2025 14:43
const searchIcon = headerEl.querySelector(
`[aria-controls="${stickyHeaderId.slice(1)}"]`
);
const isHeaderExpanded = stickyHeaderContainer
Copy link
Contributor Author

@notlee notlee Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier. This is a one line change, here. isHeaderExpanded is false if stickyHeaderContainer is not found.

@notlee notlee temporarily deployed to origami-webs-o-header-s-3dbzxy March 27, 2025 14:45 Inactive
</div>
</div>
);
return <></>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all of this been removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh woops 😅 Yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sticky header not working for simplified headers (o-header)
2 participants