Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plenty-sloths-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Removes an invalid `value` attribute from the language and theme selectors
1 change: 0 additions & 1 deletion packages/starlight/components/LanguageSelect.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function localizedPathname(locale: string | undefined): string {
<Select
icon="translate"
label={Astro.locals.t('languageSelect.accessibleLabel')}
value={localizedPathname(Astro.locals.starlightRoute.locale)}
options={Object.entries(config.locales).map(([code, locale]) => ({
value: localizedPathname(code),
selected: code === Astro.locals.starlightRoute.locale,
Expand Down
3 changes: 1 addition & 2 deletions packages/starlight/components/Select.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Icon from '../user-components/Icon.astro';

interface Props {
label: string;
value: string;
icon: Parameters<typeof Icon>[0]['name'];
width?: string;
options: Array<{
Expand All @@ -26,7 +25,7 @@ interface Props {
<label style={`--sl-select-width: ${Astro.props.width}`}>
<span class="sr-only">{Astro.props.label}</span>
<Icon name={Astro.props.icon} class="icon label-icon" />
<select value={Astro.props.value} autocomplete="off">
<select autocomplete="off">
{
Astro.props.options.map(({ value, selected, label }) => (
<option value={value} selected={selected} set:html={label} />
Expand Down
1 change: 0 additions & 1 deletion packages/starlight/components/ThemeSelect.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Select from './Select.astro';
<Select
icon="laptop"
label={Astro.locals.t('themeSelect.accessibleLabel')}
value="auto"
options={[
{ label: Astro.locals.t('themeSelect.dark'), selected: false, value: 'dark' },
{ label: Astro.locals.t('themeSelect.light'), selected: false, value: 'light' },
Expand Down
Loading