-
Notifications
You must be signed in to change notification settings - Fork 158
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
fix(sticky-header): do not consider vertical ToC height in calculations #10605
fix(sticky-header): do not consider vertical ToC height in calculations #10605
Conversation
Deploy preview created for package Built with commit: eebbfc29f2bea5aa3ee599e625ceb40efaea1973 |
Deploy preview created for package Built with commit: eebbfc29f2bea5aa3ee599e625ceb40efaea1973 |
Deploy preview created for package Built with commit: eebbfc29f2bea5aa3ee599e625ceb40efaea1973 |
Deploy preview created for package Built with commit: eebbfc29f2bea5aa3ee599e625ceb40efaea1973 |
@@ -114,7 +114,7 @@ class StickyHeader { | |||
const leadspaceSearchBar = component.shadowRoot.querySelector( | |||
`.${prefix}--search-container` | |||
); | |||
this._leadspaceWithSearchBar = leadspaceSearchBar; | |||
this._leadspaceSearchBar = leadspaceSearchBar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the following similar change was done to match the name of the property defined in this class's constructor.
Deploy preview created for package Built with commit: eebbfc29f2bea5aa3ee599e625ceb40efaea1973 |
We should probably update the storybook story that helps demo this utility. Can we add a knob to add the L1 menu? |
Deploy preview created for package Built with commit: eebbfc29f2bea5aa3ee599e625ceb40efaea1973 |
@andy-blum Looks like we have a knob for that already. ![]() |
Deploy preview created for package Built with commit: eebbfc29f2bea5aa3ee599e625ceb40efaea1973 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Related Ticket(s)
Description
The StickyHeader utility has logic for how to calculate the total height of elements on a given web page that are "stuck" to the top of the viewport. It exposes a CSS custom property,
--dds-sticky-header-height
, with this calculated value for other page elements to use.In AEM, we were seeing this value be set much higher than the actual sum height of all stuck elements. It turns out we were adding the height of
<dds-table-of-contents>
elements that are configured to use the vertical presentation, which is unnecessary.Changelog
Changed
<dds-table-of-contents>
in the vertical orientation from--dds-sticky-header-height
calculation when appropriate.<dds-table-of-contents>
in the horizontal orientation from--dds-sticky-header-height
calculation until it is sticking to the top of the viewport.<dds-leadspace-with-search>
, allowing those elements to be properly factored into calculations.Testing Instructions
Visit the Dotcom Shell deploy preview's various Stories and verify the
--dds-sticky-header-height
custom property set on the root element has a value that matches the current "stuck" elements' height.