Skip to content

chore: remove unused mounting variable from select_option call #16312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ export function attribute_effect(
var current = set_attributes(element, prev, next, css_hash, skip_warning);

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)) {
Expand All @@ -514,10 +514,9 @@ export function attribute_effect(

if (is_select) {
var select = /** @type {HTMLSelectElement} */ (element);
var mounting = true;

effect(() => {
select_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, mounting);
mounting = false;
select_option(select, /** @type {Record<string | symbol, any>} */ (prev).value, true);
init_select(select);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import * as w from '../../../warnings.js';
* @template V
* @param {HTMLSelectElement} select
* @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 value is null or undefined, keep the selection as is
if (value == undefined) {
Expand Down