chore: remove unused `mounting` variable from `select_option` call

pull/16312/head
Rich Harris 3 months ago
parent 834cd91b36
commit 0f107d2671

@ -491,7 +491,7 @@ export function attribute_effect(
var current = set_attributes(element, prev, next, css_hash, skip_warning); var current = set_attributes(element, prev, next, css_hash, skip_warning);
if (inited && is_select && 'value' in next) { if (inited && is_select && 'value' in next) {
select_option(/** @type {HTMLSelectElement} */ (element), next.value, false); select_option(/** @type {HTMLSelectElement} */ (element), next.value);
} }
for (let symbol of Object.getOwnPropertySymbols(effects)) { for (let symbol of Object.getOwnPropertySymbols(effects)) {
@ -514,10 +514,9 @@ export function attribute_effect(
if (is_select) { if (is_select) {
var select = /** @type {HTMLSelectElement} */ (element); var select = /** @type {HTMLSelectElement} */ (element);
var mounting = true;
effect(() => { effect(() => {
select_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, mounting); select_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, true);
mounting = false;
init_select(select); init_select(select);
}); });
} }

@ -9,9 +9,9 @@ import * as w from '../../../warnings.js';
* @template V * @template V
* @param {HTMLSelectElement} select * @param {HTMLSelectElement} select
* @param {V} value * @param {V} value
* @param {boolean} [mounting] * @param {boolean} mounting
*/ */
export function select_option(select, value, mounting) { export function select_option(select, value, mounting = false) {
if (select.multiple) { if (select.multiple) {
// If value is null or undefined, keep the selection as is // If value is null or undefined, keep the selection as is
if (value == undefined) { if (value == undefined) {

Loading…
Cancel
Save