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

feat: add select spec #3619

Open
wants to merge 9 commits into
base: master
from
Open

feat: add select spec #3619

wants to merge 9 commits into from

Conversation

@eljefe223
Copy link
Contributor

eljefe223 commented Aug 4, 2020

Description

Adds spec for <fast-select/> and <fast-option/>

Issue type checklist

  • Chore: A change that does not impact distributed packages.
  • Bug fix: A change that fixes an issue, link to the issue above.
  • New feature: A change that adds functionality.

Is this a breaking change?

  • This change causes current functionality to break.

Adding or modifying component(s) in @microsoft/fast-components checklist

Process & policy checklist

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.
@eljefe223 eljefe223 requested review from awentzel, Falkicon and janechu as code owners Aug 4, 2020
@eljefe223 eljefe223 self-assigned this Aug 4, 2020
@eljefe223 eljefe223 force-pushed the users/jes/select-spec branch from 012934b to 10ae476 Aug 4, 2020
@EisenbergEffect
Copy link
Contributor

EisenbergEffect commented Aug 4, 2020

@eljefe223 Doesn't look like I'll get a chance to review today but I'll try to take a look first thing in the morning. Real quick, I wanted to mention that there's a lot of work on select happening in OpenUI. If you haven't checked that out, take a look since we want to try to align with them as much as possible and we may then also have some feedback into that process.

@chrisdholt
Copy link
Member

chrisdholt commented Aug 4, 2020

@eljefe223 Doesn't look like I'll get a chance to review today but I'll try to take a look first thing in the morning. Real quick, I wanted to mention that there's a lot of work on select happening in OpenUI. If you haven't checked that out, take a look since we want to try to align with them as much as possible and we may then also have some feedback into that process.

As FYI @EisenbergEffect this is based off the OpenUI work. FYI to @gregwhitworth that we're officially starting work in FAST on select as part of our partnership 😄

@EisenbergEffect
Copy link
Contributor

EisenbergEffect commented Aug 4, 2020

Awesome. I hadn't had a chance to review yet but just wanted to double check that at the start.

@janechu
Copy link
Member

janechu commented Aug 5, 2020

You may want to move this to /specs since that's typically where they start before implementation.

@eljefe223
Copy link
Contributor Author

eljefe223 commented Aug 5, 2020

You may want to move this to /specs since that's typically where they start before implementation.

@janechu Yeah, I sort of did this out of defiance, Is there a good reason we do it this way? I'm happy to move it, but I it seems weird that we place it in specs only temporarily and then ultimately move it into its own folder.

@eljefe223 eljefe223 force-pushed the users/jes/select-spec branch from f752eed to fcc3600 Aug 5, 2020
@janechu
Copy link
Member

janechu commented Aug 5, 2020

@eljefe223 Well, speaking broadly, I think we wanted to keep it so that specs are find-able for things (not just components) that were being worked on conceptually but did not yet have any code associated with them. When they do have code associated then we would move them to tie them to the code as documentation. If, for example, you wrote a spec and it stayed in some nested folder and it was forgotten, someone might be going through the /specs folder, identifying things to contribute and have no idea that in some nested folder somewhere was a spec that could be used for contribution.

@eljefe223 eljefe223 force-pushed the users/jes/select-spec branch from fcc3600 to 408eaaf Aug 6, 2020
specs/select.spec.md Outdated Show resolved Hide resolved
specs/select.spec.md Show resolved Hide resolved
- `fast-select`

*Attributes:*
- `autocomplete` - Allows the developer to provide a hint on how to search the content within the `<fast-option>`(s)

This comment has been minimized.

Copy link
@EisenbergEffect

EisenbergEffect Aug 7, 2020

Contributor

Would be great to see a more through explanation of how this is intended to work.

This comment has been minimized.

Copy link
@eljefe223

eljefe223 Aug 10, 2020

Author Contributor

I was following the Open UI spec, I believe in the past we filtered the potential results, but thinking about this I'm a bit confused on why select would have this. This seems like more of feature of a dropdown on an autosuggest of textbox. @gregwhitworth can you clarify this feature?

This comment has been minimized.

Copy link
@chrisdholt

chrisdholt Aug 11, 2020

Member

We can also hold on adding autocomplete in the initial implementation.

This comment has been minimized.

Copy link
@chrisdholt

chrisdholt Aug 11, 2020

Member

Actually this may be a good thing to move to "next steps" - investigate autocomplete, etc...

This comment has been minimized.

Copy link
@eljefe223

eljefe223 Aug 12, 2020

Author Contributor

@gregwhitworth and I were having a discussion offline and wanted to include those discussions here.

We will move this to next steps but wondering if select should have a text input or not, This seems more like a combobox or search box to me. I could not find any documentation online that "searching" options should be part of a select.

My issue with using the terminology of "search" is that when you search the text you input is not always in the suggested dropdown, which makes it not a select. Because you are not selecting some predetermined value

specs/select.spec.md Outdated Show resolved Hide resolved
specs/select.spec.md Outdated Show resolved Hide resolved
specs/select.spec.md Outdated Show resolved Hide resolved

### Features
- Select one or multiple `<fast-option/>`(s) using the `multiple` attribute
- When Dropdown does not have enough screen real estate to open below `<fast-select>` it will open above.

This comment has been minimized.

Copy link
@scomea

scomea Aug 7, 2020

Member

Do we want more positioning choices (ie. always open above)? Leaving that to later version works too.

This comment has been minimized.

Copy link
@scomea

scomea Aug 7, 2020

Member

Have you thought about how the flyout menu is placed in the dom, breaks out of parent containers or not, positioning mode?

This comment has been minimized.

Copy link
@eljefe223

eljefe223 Aug 7, 2020

Author Contributor

I'm open here, but thinking it would just use the intersection observer work you have done.

- `required` - boolean value that sets the field as required
- `selectedIndex` - The index of the first or last selected `<fast-option>` element, depending on the value of `multiple`
- `selectedOptions` - An `HTMLCollection` of the selected `<fast-option>` elements
- `size` - If the `<fast-select>` is shown with a scrollbar, this represents how many `<fast-option>`s are visible.

This comment has been minimized.

Copy link
@scomea

scomea Aug 7, 2020

Member

Not clear on what 'size' does. Does it control the height of the menu?

This comment has been minimized.

Copy link
@gregwhitworth

gregwhitworth Aug 7, 2020

It controls how many options are visible within the listbox which does indirectly control the height of the listbox. https://html.spec.whatwg.org/multipage/form-elements.html#attr-select-size

This comment has been minimized.

Copy link
@scomea

scomea Aug 12, 2020

Member

Is this necessary if folks can use css to control listbox dimensions?

@gregwhitworth
Copy link

gregwhitworth commented Aug 7, 2020

FYI to @gregwhitworth that we're officially starting work in FAST on select as part of our partnership

Can you make sure to file or provide feedback against the Open UI spec as you find gaps and if you have a proposal put it into the issue or file a PR?

@@ -0,0 +1,158 @@
# Select + Select-Option

This comment has been minimized.

Copy link
@awentzel

awentzel Aug 10, 2020

Member

I think there should be some documentation around proper usage of a Select inside or outside of a <form>

specs/select.spec.md Outdated Show resolved Hide resolved
specs/select.spec.md Outdated Show resolved Hide resolved
- `menu-open` -If the menu of the `<fast-option>` is open or not
- `multiple` - Allows user to select more than one `<fast-option>`
- `name` - Name of the control
- `options` - Returns an array of the `<fast-option>` elements contained by the `<fast-select>` element

This comment has been minimized.

Copy link
@janechu

janechu Aug 10, 2020

Member

Are we expecting this list of options to be updated at any point? If you are the use of index for selected-index and selected-options may be problematic.

This comment has been minimized.

Copy link
@eljefe223

eljefe223 Aug 12, 2020

Author Contributor

We use this type of language elsewhere like active-id or selected-index the are attributes that can be updated in the DOM when a selection change is made. It can be initially set by the app author. Tabs is a goos example of this:

Screen Shot 2020-08-12 at 9 02 00 AM

Screen Shot 2020-08-12 at 9 01 55 AM

specs/select.spec.md Show resolved Hide resolved
specs/select.spec.md Show resolved Hide resolved
@eljefe223 eljefe223 force-pushed the users/jes/select-spec branch from e85dd9c to f45015e Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.