Skip to content

Commit 4a26edf

Browse files
authored
chore: remove unused mounting variable from select_option call (#16312)
1 parent 834cd91 commit 4a26edf

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/svelte/src/internal/client/dom/elements/attributes.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ export function attribute_effect(
491491
var current = set_attributes(element, prev, next, css_hash, skip_warning);
492492

493493
if (inited && is_select && 'value' in next) {
494-
select_option(/** @type {HTMLSelectElement} */ (element), next.value, false);
494+
select_option(/** @type {HTMLSelectElement} */ (element), next.value);
495495
}
496496

497497
for (let symbol of Object.getOwnPropertySymbols(effects)) {
@@ -514,10 +514,9 @@ export function attribute_effect(
514514

515515
if (is_select) {
516516
var select = /** @type {HTMLSelectElement} */ (element);
517-
var mounting = true;
517+
518518
effect(() => {
519-
select_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, mounting);
520-
mounting = false;
519+
select_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, true);
521520
init_select(select);
522521
});
523522
}

packages/svelte/src/internal/client/dom/elements/bindings/select.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import * as w from '../../../warnings.js';
99
* @template V
1010
* @param {HTMLSelectElement} select
1111
* @param {V} value
12-
* @param {boolean} [mounting]
12+
* @param {boolean} mounting
1313
*/
14-
export function select_option(select, value, mounting) {
14+
export function select_option(select, value, mounting = false) {
1515
if (select.multiple) {
1616
// If value is null or undefined, keep the selection as is
1717
if (value == undefined) {

0 commit comments

Comments
 (0)