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: Naming of <selectedoption> #1112

Open
jakearchibald opened this issue Oct 18, 2024 · 12 comments
Open

select: Naming of <selectedoption> #1112

jakearchibald opened this issue Oct 18, 2024 · 12 comments
Labels
select These are issues that relate to the select component

Comments

@jakearchibald
Copy link
Contributor

jakearchibald commented Oct 18, 2024

Sorry, I know bikeshedding is painful, but it's really awkward that "the <selectedoption>" and "the selected <option>" are different things, even though they sound the same verbally.

Try saying "the <selectedoption> contains a clone of the content of the selected <option>" out loud. You need to say something like "the <selectedoption> contains a clone of the content of the <option> that is selected" to make it understandable, but that also sounds weird.

It's a problem in code too:

const selectedOption = select.selectedOptions[0];
const selectedOption = select.querySelector('selectedoption');
@lukewarlow
Copy link
Collaborator

For context here's the original discussion on naming: #808

There were a few proposals. I liked value or selectedvalue but it was pointed out that's not quite right because it's not actually the value. selected is perhaps too ambiguous?

There's no prior art from which to base the naming off unfortunately.

Potentially worth considering what might the element look like for select multiple in future?

@jakearchibald
Copy link
Contributor Author

<selectedcontent> is the best I've got.

@brucelawson
Copy link

brucelawson commented Oct 18, 2024 via email

@lukewarlow lukewarlow added the select These are issues that relate to the select component label Oct 18, 2024
@smhigley
Copy link
Collaborator

smhigley commented Oct 21, 2024

<selection> feels a little close to text selection to me 😅

I kinda like <selectedcontent> in that it makes it a little more intuitive that it's a semantically generic container mirroring the content of the selected option, and not literally a semantic option nested inside the button.

@jakearchibald
Copy link
Contributor Author

I've seen a few folks that think <selectedoption> is a replacement for <option selected>, which is totally understandable.

@josepharhar josepharhar added the agenda+ Use this label if you'd like the topic to be added to the meeting agenda label Oct 24, 2024
@josepharhar
Copy link
Collaborator

I agree, <selectedoption> verbally conflates with "selected <option>" really badly. <selectedcontent> sounds good to me.

@sorvell
Copy link

sorvell commented Oct 25, 2024

What about repurposing the <output> element for this?

It probably doesn't work, but it seems at least conceptually similar since it's primarily displaying the result of a user action.

@jakearchibald
Copy link
Contributor Author

That feels like a pretty big semantic switch.

@sorvell
Copy link

sorvell commented Oct 28, 2024

claude.ai thinks choice is the strongest option:

<select>
  <button>
    <choice>Apple</choice> <!-- automatically updates when selection changes -->
  </button>
  <option value="apple">Apple</option>
  <option value="banana">Banana</option>
</select>

choice works well because it:

  1. Is distinct from other select-related terms
  2. Clearly represents its purpose
  3. Is short and simple
  4. Isn't easily confused with existing properties
  5. Makes semantic sense in the context

@josepharhar
Copy link
Collaborator

Here is our previous thread on naming, where we renamed it from <selectedvalue> to <selectedoption>: #808

I'd rather not use <output> for this since it already has semantics/behaviors.

I like <selectedcontent> because it represents the content of the currently selected option. <choice> sounds a bit vague by comparison.

@brechtDR
Copy link
Collaborator

+1 on slectedcontent

@css-meeting-bot
Copy link

The Open UI Community Group just discussed select: Naming of <selectedoption>, and agreed to the following:

  • RESOLVED: rename the selectedoption element to selectedcontent
The full IRC log of that discussion <frehner> Hoping to gain enough context in the next couple of sessions to start scribing :)
<gregwhitworth> jarhar: selectedcontent will be the new name for selectedoption
<gregwhitworth> masonf: the name is confusing currently and my initial position and in programming it can be confusing. Using it as your first option in select and "oops it didn't work"
<gregwhitworth> q+
<gregwhitworth> ack gregwhitworth
<gregwhitworth> steve: Jake voted for selectedcontent as well
<gregwhitworth> steve: to level set this is not a final solution
<gregwhitworth> masonf: we don't make final decisions here but make recommendations
<masonf> q+
<gregwhitworth> steve: only issue is that the name is verbose and long and it seems odd that the parent element is the name
<gregwhitworth> steve: I do agree with Jake that it is quite confusing and only concern is it is long
<gregwhitworth> steve: it solves the primary problem
<gregwhitworth> masonf: it is selected and not select so it is slight variation. This is clear that it is just the content and not the option
<jarhar> q?
<masonf> ack mason
<gregwhitworth> ack masonf
<bkardell_> the output paradigm would be more useful if anyone outside this chat knew about <output> ;)
<masonf> <output> is form associated, which adds even more stuff to deal with
<jarhar> proposed resolution: rename the selectedoption element to selectedcontent
<masonf> +1
<bkardell_> +1
<gregwhitworth> +1
<sarah> +1
<scott> +1
<jarhar> RESOLVED: rename the selectedoption element to selectedcontent

@gregwhitworth gregwhitworth removed the agenda+ Use this label if you'd like the topic to be added to the meeting agenda label Nov 6, 2024
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 8, 2024
This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
aarongable pushed a commit to chromium/chromium that referenced this issue Nov 8, 2024
This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1380043}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 8, 2024
This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1380043}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 8, 2024
This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1380043}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 10, 2024
…ent>, a=testonly

Automatic update from web-platform-tests
Rename <selectedoption> to <selectedcontent>

This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1380043}

--

wpt-commits: 87038037a69d96cbfa83f2dc370f8478ff472851
wpt-pr: 49046
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Nov 12, 2024
…ent>, a=testonly

Automatic update from web-platform-tests
Rename <selectedoption> to <selectedcontent>

This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1380043}

--

wpt-commits: 87038037a69d96cbfa83f2dc370f8478ff472851
wpt-pr: 49046
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Nov 16, 2024
…ent>, a=testonly

Automatic update from web-platform-tests
Rename <selectedoption> to <selectedcontent>

This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <tcaptanchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1380043}

--

wpt-commits: 87038037a69d96cbfa83f2dc370f8478ff472851
wpt-pr: 49046

UltraBlame original commit: 6393fac1affe9d3e6dd207155f579042ae319983
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Nov 16, 2024
…ent>, a=testonly

Automatic update from web-platform-tests
Rename <selectedoption> to <selectedcontent>

This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <tcaptanchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1380043}

--

wpt-commits: 87038037a69d96cbfa83f2dc370f8478ff472851
wpt-pr: 49046

UltraBlame original commit: 6393fac1affe9d3e6dd207155f579042ae319983
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Nov 16, 2024
…ent>, a=testonly

Automatic update from web-platform-tests
Rename <selectedoption> to <selectedcontent>

This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <tcaptanchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1380043}

--

wpt-commits: 87038037a69d96cbfa83f2dc370f8478ff472851
wpt-pr: 49046

UltraBlame original commit: 6393fac1affe9d3e6dd207155f579042ae319983
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Nov 16, 2024
…ent>, a=testonly

Automatic update from web-platform-tests
Rename <selectedoption> to <selectedcontent>

This rename was decided here:
openui/open-ui#1112

Change-Id: I5ed2a5b7dca3d6c62ad73c609eed898dca44cefd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983471
Reviewed-by: Traian Captan <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1380043}

--

wpt-commits: 87038037a69d96cbfa83f2dc370f8478ff472851
wpt-pr: 49046
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
select These are issues that relate to the select component
Projects
None yet
Development

No branches or pull requests

9 participants