Skip to content

Commit

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

Fix warning which becomes an error with Svelte v5 tooling (PR #6020).

```
/Users/daviddalbusco/projects/dfinity/nns-dapp/frontend/src/lib/components/accounts/SelectNetworkDropdown.svelte
  62:6  error  `<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.
https://svelte.dev/e/node_invalid_placement(node_invalid_placement)  svelte/valid-compile
```

# Changes

- Remove `span` in `option`.

Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker authored Dec 17, 2024
1 parent 01f09e4 commit c165a28
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
testId="select-network-dropdown"
>
<option disabled selected value={undefined} class="hidden"
><span class="description">{$i18n.accounts.select_network}</span></option
>{$i18n.accounts.select_network}</option
>
<DropdownItem value={TransactionNetwork.ICP}
>{$i18n.accounts.network_icp}</DropdownItem
Expand Down

0 comments on commit c165a28

Please sign in to comment.