Skip to content

Alert title prop is not rendered as visible alert content #26

Description

@dbarlag

What happened

The RK Alert wrapper declares a dedicated title prop and its Storybook stories use it as the alert heading. The wrapper forwards that value unchanged to Digdir Alert, which currently renders a div. As a result, title becomes the native HTML title attribute (hover tooltip) and no visible heading is rendered.

Expected behavior

The documented title prop should render visible, semantic alert title content, or the RK API/stories should remove that promise and demonstrate an explicit heading child instead.

Reproduction

  1. Open Components / Alert / Informasjon in Storybook.
  2. Observe that Informasjon is not rendered as visible alert content.
  3. Inspect the alert div and see title=Informasjon.

Impact

Consumers following the RK stories can believe they supplied a visible alert heading when they only supplied a browser tooltip. This can weaken content hierarchy and accessibility.

Severity

Medium.

Notes

Discovered while adding the universal static-contract story. The contract test intentionally covers observable message content and prop reflection without encoding the missing title as expected behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions