Skip to content

[Bug:] Tooltip onOpen triggered multiple times #4123

Description

@alu-LV9Q

Describe the Bug

In cmsgov/ds-medicare-gov version "18.0.0", when using the <Tooltip> component with close button and clicking on the Tooltip trigger to show the tooltip content, onOpen is called multiple times (approximately 7 times).

This is the code from the example page. I added onOpen and enabled analytics When Tooltip trigger is clicked, "tooltip opened" is displayed multiple times in console and "tooltip_viewed" analytic event is fired multiple times.

<Tooltip
  className="ds-c-button"
  contentHeading="Really long Heading for tooltip"
  dialog
  analytics
  showCloseButton
  onOpen={() => {
    console.log("tooltip opened");
  }}
  title={<>Entering your Social Security Number helps the plan confirm with your state that you have Medicaid.</>}
>
  Tooltip trigger
</Tooltip>

To reproduce

Use the example code to reproduce.

Expected behavior

onOpen is trigged only once and "tooltip_viewed" analytic event is fired only once.

Severity/Impact

High: Affects PI objectives, breaks 508 compliance, breaks application

Desktop Operating System

No response

Desktop Browser Name

No response

Desktop Browser Version

No response

Device

No response

Mobile Operating System

No response

Mobile Browser Name

No response

Mobile Browser Version

No response

Additional context

No response

Codebase/Repository URL

No response

Design System Version

cmsgov/ds-medicare-gov version "18.0.0"

Existing branch or Pull request on Github

No response

Team Name

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impacts: CoreImpacts the core DS primarily, changes may occur in other themes as well.Impacts: DocumentationIndicates that this item relates to documentationImpacts: HealthcareImpacts the Healthcare.gov theme directly.Impacts: MedicareImpacts the Medicare theme directly.Status: In JIRAIndicates that this item is also tracked in JiraStatus: Work In ProgressPR's that are not yet ready for reviewdependenciesPull requests that update a dependency filejavascriptPull requests that update javascript code

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions