Skip to content

Commit

Permalink
fix(frontend): span cannot be a child of option (#3930)
Browse files Browse the repository at this point in the history
# Motivation

It's probably a warning currently but, following becomes an error when
migrating to Svelte v5 in #3929:

> `<span>` cannot be a child of `<option>`. `<option>` only allows these
children: `<#text>`. The browser will 'repair' the HTML (by moving,
removing, or inserting elements) which breaks Svelte's assumptions about
the structure of your components.

# Changes

- Remove `span` in `option`.
  • Loading branch information
peterpeterparker authored Dec 11, 2024
1 parent d9915f9 commit cd5b04d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/frontend/src/eth/components/send/SendNetwork.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<div id="network" class="mb-4 mt-1 pt-0.5">
<Dropdown name="network" bind:selectedValue={networkName}>
<option disabled selected value={undefined} class="hidden"
><span class="description">{$i18n.send.placeholder.select_network}</span></option
>{$i18n.send.placeholder.select_network}</option
>
<DropdownItem value={ETHEREUM_NETWORK.name}>{ETHEREUM_NETWORK.name}</DropdownItem>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
<div id="network" class="network mt-1 pt-0.5">
<Dropdown name="network" bind:selectedValue={networkName}>
<option disabled selected value={undefined} class:hidden={nonNullish(networkName)}
><span class="description">{$i18n.tokens.manage.placeholder.select_network}</span
></option
>{$i18n.tokens.manage.placeholder.select_network}</option
>
{#each availableNetworks as network}
<DropdownItem value={network.name}>{network.name}</DropdownItem>
Expand Down

0 comments on commit cd5b04d

Please sign in to comment.