Home > widget-integration > RecommendationWidgetController > getDropdownNodeKey

RecommendationWidgetController.getDropdownNodeKey() method

Generates the CSS selector for dropdown elements.

Creates a CSS selector that targets dropdown container elements for variant selection. Override this method to customize dropdown element targeting or modify the selector structure.

Signature:

getDropdownNodeKey(widgetId: string): string;

Parameters

Parameter

Type

Description

widgetId

string

The unique identifier of the widget used in the selector ID

Returns:

string

CSS selector string targeting dropdown container elements for the specified widget

Example

Override to use custom dropdown ID format:

public getDropdownNodeKey(widgetId: string): string {
  return `[data-widget-dropdown="${widgetId}"]`;
}