Closed
Description
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
- 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. - 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? - color-picker-swatch:
<Host aria-label={hex} title={hex}>
Why title? Should it be internal? - combobox-item:
<Host aria-hidden disabled={this.disabled} scale={scale} tabIndex={-1}>
Why disabled? Scale as well? These are already props. - combobox-item-group:
<Host scale={scale}>
Why scale here? - dropdown-group:
<Host role="menu" scale={scale} title={this.groupTitle}>
Why title & scale? - 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? - input-message:
<Host calcite-hydrated-hidden={hidden} theme={this.theme}>
Why theme? - modal:
<Host aria-modal="true" is-active={this.isActive} role="dialog">
Why is-active? - notice:
<Host active={this.active} dir={dir}>
Why active? - radio-button:
<Host labeled={!!this.el.textContent}>
Why labeled? what is that for? - radio-group-item:
<Host appearance={appearance} aria-checked={checked.toString()} layout={layout} role="radio" scale={scale}>
Why appearnace, layout, scale? - slider:
<Host id={id} is-range={this.isRange}>
Why isRange? - 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? - value-list-item:
<Host data-id={this.guid}>
Why data-id?
Relevant Info
- accordion-item (@jcfranco)
- alert (@jcfranco)
- color-picker-swatch (@jcfranco)
- combobox-item (@jcfranco)
- combobox-item-group (@jcfranco)
- dropdown-group
- dropdown-item
- input-message (@caripizza) feat(alert, button, chip, inline-editable, input-message, link, scrim): move theme attribute styles to global.scss #2114
- modal
- notice
- radio-button
- radio-group-item
- slider
- tab-title
- value-list-item
Metadata
Metadata
Assignees
Labels
Issues that have been tested, confirmed as mitigated, and are ready to close.Issues tied to the core infrastructure of calcite-components.Bug reports for broken functionality. Issues should include a reproduction of the bug.Issues relating to conventions and best practices.Issues relating to a conversation where feedback is optional.