Skip to content

[getLabelText] Add labelText as first fallback after label #14872

Description

@isaacbraun

monday.com sync: #12613802737

Check existing issues

Which Component

N/A

Description

Brought up in #14845 (comment), the getLabelText() utility should be enhanced to use labelText as the first fallback before looking for the textContent element.

Additionally, getting the labelEl.textContent element may no longer be needed now that labels are internal to the component. Unless we still want to fallback to external labels.

Existing:

export function getLabelText(component: LabelTextComponent): string {
  return component.label || component.labelEl?.textContent?.trim() || "";
}

Improved:

export function getLabelText(component: LabelTextComponent): string {
  return component.label || component.labelText || component.labelEl?.textContent?.trim() || "";
}

Acceptance Criteria

  • getLabelText() looks for these values in the following order: label, labelText, labelEl (up for discussion).

Relevant Info

No response

Example Use Case

No response

Priority impact

impact - p3 - not time sensitive

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

Calcite (dev)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Calcite (dev)Issues logged by Calcite developers.calcite-componentsIssues specific to the @esri/calcite-components package.enhancementIssues tied to a new feature or request.impact - p3 - not time sensitiveUser set priority impact status of p3 - not time sensitiveneeds triagePlanning workflow - pending design/dev review.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions