Skip to content

ObjectPage: AnchorBar collapse/expand button ignores --sapButton_Hover_Background on hover #8951

Description

@VidhiNPatel

Describe the bug

The collapse/expand button (ObjectPageAnchorBarExpandBtn) in the ObjectPage
AnchorBar does not apply the correct hover background color. On hover, the button
stays #ffffff (from --sapObjectHeader_Background) instead of switching to
--sapButton_Hover_Background (#EAECEE).

This was flagged by the SAP UXC Scanner (UXC-010 Colors rule) and verified by
DOM inspection.

Root cause: The _anchorBarActionButton CSS class sets background-color: var(--sapObjectHeader_Background) on the host element. Per CSS Shadow DOM cascade
rules, external document styles targeting a custom element host take precedence
over the shadow DOM's :host:hover rule — so the UI5 button's internal hover
style never fires.

Isolated Example

Reproduced on the official Storybook (no custom CSS): https://ui5.github.io/webcomponents-react/v2/?path=/docs/layouts-floorplans-object page--docs

Reproduction steps

  1. Render an ObjectPage with a headerArea (see Storybook default example)
  2. Hover over the collapse (∧) or expand (∨) button in the AnchorBar
  3. Observe the button background color

Expected Behaviour

Button background changes to var(--sapButton_Hover_Background) = #EAECEE on
hover, as defined by the SAP Fiori design token for Standard Button hover state.

Screenshots or Videos

Image

UI5 Web Components for React Version

2.26.0

UI5 Web Components Version

2.26.0

Browser

Chrome

Operating System

No response

Additional Context

No response

Relevant log output

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions