Skip to content

Commit 97e8103

Browse files
anderskdelucis
andauthored
Remove invalid value attribute from <select> (#3421)
Co-authored-by: Chris Swithinbank <[email protected]>
1 parent 9200fac commit 97e8103

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.changeset/plenty-sloths-repeat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/starlight': patch
3+
---
4+
5+
Removes an invalid `value` attribute from the language and theme selectors

packages/starlight/components/LanguageSelect.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ function localizedPathname(locale: string | undefined): string {
1818
<Select
1919
icon="translate"
2020
label={Astro.locals.t('languageSelect.accessibleLabel')}
21-
value={localizedPathname(Astro.locals.starlightRoute.locale)}
2221
options={Object.entries(config.locales).map(([code, locale]) => ({
2322
value: localizedPathname(code),
2423
selected: code === Astro.locals.starlightRoute.locale,

packages/starlight/components/Select.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Icon from '../user-components/Icon.astro';
33
44
interface Props {
55
label: string;
6-
value: string;
76
icon: Parameters<typeof Icon>[0]['name'];
87
width?: string;
98
options: Array<{
@@ -26,7 +25,7 @@ interface Props {
2625
<label style={`--sl-select-width: ${Astro.props.width}`}>
2726
<span class="sr-only">{Astro.props.label}</span>
2827
<Icon name={Astro.props.icon} class="icon label-icon" />
29-
<select value={Astro.props.value} autocomplete="off">
28+
<select autocomplete="off">
3029
{
3130
Astro.props.options.map(({ value, selected, label }) => (
3231
<option value={value} selected={selected} set:html={label} />

packages/starlight/components/ThemeSelect.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Select from './Select.astro';
77
<Select
88
icon="laptop"
99
label={Astro.locals.t('themeSelect.accessibleLabel')}
10-
value="auto"
1110
options={[
1211
{ label: Astro.locals.t('themeSelect.dark'), selected: false, value: 'dark' },
1312
{ label: Astro.locals.t('themeSelect.light'), selected: false, value: 'light' },

0 commit comments

Comments
 (0)