Skip to content

Bug: Refactoring host element inconsistencies #2059

Closed
@driskull

Description

@driskull

Actual Behavior

Some of the components are setting attributes on the host element and they maybe shouldn't be. Lets discuss what to do in these scenarios.

Expected Behavior

Host element should only have needed props and attributes applied to it. Things like aria roles, tabIndex, id and event listeners.

Reproduction Steps or Sample

  1. accordion-item: <Host aria-expanded={this.active.toString()} icon-position={this.iconPosition} tabindex="0"> Why iconPosition? Should it be a prop? iconPosition is a private variable but gets set on the host element.
  2. alert: <Host active={active} aria-hidden={hidden.toString()} aria-label={this.label} calcite-hydrated-hidden={hidden} queued={this.queued} role={role}> Why queued and active?
  3. color-picker-swatch: <Host aria-label={hex} title={hex}> Why title? Should it be internal?
  4. combobox-item: <Host aria-hidden disabled={this.disabled} scale={scale} tabIndex={-1}> Why disabled? Scale as well? These are already props.
  5. combobox-item-group: <Host scale={scale}> Why scale here?
  6. dropdown-group: <Host role="menu" scale={scale} title={this.groupTitle}> Why title & scale?
  7. dropdown-item: <Host aria-checked={itemAria} dir={dir} isLink={this.href} role={itemRole} scale={scale} selection-mode={this.selectionMode} tabindex="0"> Why isLink, scale, selectionMode?
  8. input-message: <Host calcite-hydrated-hidden={hidden} theme={this.theme}>Why theme?
  9. modal: <Host aria-modal="true" is-active={this.isActive} role="dialog"> Why is-active?
  10. notice: <Host active={this.active} dir={dir}> Why active?
  11. radio-button: <Host labeled={!!this.el.textContent}> Why labeled? what is that for?
  12. radio-group-item: <Host appearance={appearance} aria-checked={checked.toString()} layout={layout} role="radio" scale={scale}> Why appearnace, layout, scale?
  13. slider: <Host id={id} is-range={this.isRange}> Why isRange?
  14. tab-title: <Host aria-controls={this.controls} aria-expanded={this.active.toString()}hasText={this.hasText} id={id} role="tab" tabindex={this.disabled ? "-1" : "0"}> Why hasText?
  15. value-list-item: <Host data-id={this.guid}> Why data-id?

Relevant Info

Metadata

Metadata

Assignees

Labels

4 - verifiedIssues that have been tested, confirmed as mitigated, and are ready to close.architectureIssues tied to the core infrastructure of calcite-components.bugBug reports for broken functionality. Issues should include a reproduction of the bug.conventionIssues relating to conventions and best practices.discussionIssues relating to a conversation where feedback is optional.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions