Skip to content

Allow for dynamic initialization of tooltip component #4055

@jakerella

Description

@jakerella

Is your feature request related to a problem? Please describe.

I dynamically add elements to my page, some of which need a tooltip. Adding the tooltip classes and attributes does not allow the USWDS tooltips to be visible (although the browser default UI is) because the JS code has already initialized the components that were present at page load.

Describe the solution you'd like

I would like the ability to "trigger", in some way, the initialization of a tooltip (or multiple) given a root node. It looks like the code already does this through the init method of the component, so I just need a way to hit that. I would like to NOT modify the USWDS codebase to do this.

Describe alternatives you've considered

I've poked around at the JS code, but since nothing is exposed on the global context, I don't see a way to re-execute the tooltip init method for a given (sub)root node.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions