six-language-switcher with SixLanguageSwitcherInput[] renders key and emits value

Open Beginner friendly
#573 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start at the six-language-switcher component and reproduce the custom-output example from the linked documentation using SixLanguageSwitcherInput[] values. Trace how each input's key and value are used for rendering and for the six-language-switcher-change event. Done means the switcher displays “French” while the event detail is “FR”, with the documented custom-language example still working.

Written by the indexing model from the issue text.

Description

Six Webcomponents version

5

Steps to reproduce

Create a six-language-switcher with custom languages of type SixLanguageSwitcherInput[].
Example taken from https://six-group.github.io/six-webcomponents/v5/components/six-language-switcher.html#custom-output

<div style="margin-top: 1rem">
  <span style="font-weight: bold">selected language: </span><span id="selected-language-custom-output">nothing selected</span>
</div>
<script type="module">
  const languageSwitcher = document.getElementById('custom-output');
  const selectedLanguage = document.getElementById('selected-language-custom-output');
  languageSwitcher.languages = [
    { key: 'FR', value: 'French' },
    { key: 'IT', value: 'Italian' },
    { key: 'DE', value: 'German' },
  ];
  languageSwitcher.addEventListener('six-language-switcher-change', (event) => {
    const { detail } = event;
    selectedLanguage.innerText = detail;
  });
</script>
What is expected?
  • Should render "French"
  • Should emit event with "FR"
What is actually happening?
  • Renders "FR"
  • Emits event with "French"
System Info
System:
    OS: Windows 11 10.0.26100
    CPU: (22) x64 Intel(R) Core(TM) Ultra 7 165H
    Memory: 24.71 GB / 63.43 GB
  Binaries:
    Node: 24.16.0 - C:\develop\bin\node24\node.EXE
    npm: 11.13.0 - C:\develop\bin\node24\npm.CMD
  Browsers:
    Chrome: 152.0.7977.55
    Edge: Chromium (151.0.4129.101)
    Firefox: 154.0 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.26100.8115
Any additional comments?

No response

Dominant language
TypeScript
Stars
30
Forks
13
Avg merge
3h 8m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from six-group/six-webcomponents

All issues in six-group/six-webcomponents

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.