Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select, Listbox, Combobox does not have label slots #4801

Closed
apsthisdev opened this issue May 28, 2021 · 7 comments
Closed

Select, Listbox, Combobox does not have label slots #4801

apsthisdev opened this issue May 28, 2021 · 7 comments
Labels
area:fast-foundation Pertains to fast-foundation closed:obsolete No longer valid community:request Issues specifically reported by a member of the community. status:needs-investigation Needs additional investigation

Comments

@apsthisdev
Copy link

fast_select and fast_list and fast-combobox does not have label slot to show the title or the label .

E.g.

<fast-select>
    <label slot="label">Title</label>
    <fast-option value="1">Option 1</fast-option>
    <fast-option value="2">Option 2</fast-option>
    <fast-option value="3">Option 3</fast-option>
</fast-select>

image

The fast_radio_group has the label slot and that helps to show the title.

<fast-radio-group>
    <label slot="label">Group label</label>
    <fast-radio>Radio label 1</fast-radio>
    <fast-radio>Radio label 2</fast-radio>
    <fast-radio>Radio label 3</fast-radio>
</fast-radio-group>

image

@apsthisdev apsthisdev added the status:triage New Issue - needs triage label May 28, 2021
@apsthisdev apsthisdev changed the title Select, Listbox does not have label slots Select, Listbox, Combobox does not have label slots May 28, 2021
@chrisdholt chrisdholt added area:fast-components area:fast-foundation Pertains to fast-foundation community:request Issues specifically reported by a member of the community. status:needs-investigation Needs additional investigation labels May 28, 2021
@chrisdholt
Copy link
Member

Thanks for filing this issue @ameyasubhedar! I think this inconsistency should definitely be addressed. With that said, I'm not sure if the right fix is to add a label or remove the labels from some of the other form controls. One thing we are running in to right now is that certain (though not all) assistive technology is having trouble resolving the link between the light DOM slotted content for labels and the slot in the Shadow DOM. We're about to do a massive a11y audit as part of our June deliverables, and I think that will (hopefully) shed some clear light on the best path forward here.

@radium-v
Copy link
Collaborator

radium-v commented Jun 1, 2021

Duplicate of #4642

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the warning:stale No recent activity within a reasonable amount of time label Apr 16, 2022
@chrisdholt
Copy link
Member

To be picked up as part of Foundation vNext

@chrisdholt chrisdholt removed the warning:stale No recent activity within a reasonable amount of time label Apr 16, 2022
@sseira
Copy link

sseira commented Aug 23, 2022

It would be great if there was an option to add the label inside the .control and sit above the <slot name="button-container">

Trying to create something like this - which is a pretty standard design direction

image

@sseira
Copy link

sseira commented Aug 23, 2022

In case anyone is trying to achieve the same thing as me, I extended Select and overrode displayValue() to add a label and it seems to be working

export class Select extends SelectFoundation {
  @attr
  label?: string

  /**
   * The value displayed on the button.
   *
   * @public
   */
  // @ts-ignore: Changing return type from string -> ViewTemplate to add label inside control
  public override get displayValue(): ViewTemplate {
    Observable.track(this, 'displayValue')
    return html`<div class="control-inner">
      ${this.label ? html`<label>${this.label}</label>` : ''}
      ${this.firstSelectedOption?.text}
    </div>`
  }
}
label.inside.select.mov

@janechu
Copy link
Collaborator

janechu commented May 28, 2024

Unfortunately @microsoft/fast-components has been deprecated for some time and @microsoft/fast-foundation is in process to be deprecated per #6955. I believe the Fluent UI web components will solve the issue in a different way as well for their v3 release.

@janechu janechu closed this as completed May 28, 2024
@janechu janechu added the closed:obsolete No longer valid label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast-foundation Pertains to fast-foundation closed:obsolete No longer valid community:request Issues specifically reported by a member of the community. status:needs-investigation Needs additional investigation
Projects
None yet
Development

No branches or pull requests

6 participants