Skip to content

Checkboxes with bind:group break the page in some circumstances #8214

@dnotes

Description

@dnotes

Describe the bug

If you bind:group some checkboxes to a property of an object, and then set that property to undefined (or a boolean, etc.) then it will break the page, stopping all execution. I think it should not break.

REPL attached. I'll provide a PR.

Reproduction

https://svelte.dev/repl/842c52bdb62448d0866785eedc7c4fcd?version=3.55.1

Logs

Uncaught (in promise) TypeError: ctx[0] is undefined update CMSWidgetOptions.svelte:285 update CMSWidgetOptions.svelte:422 update CMSWidgetOptions.svelte:577 update index.mjs:1193 flush index.mjs:1160 promise callback*schedule_update index.mjs:1118 make_dirty index.mjs:1970 ctx index.mjs:2008 cmsfieldgroup_values_binding CMSWidgetEntity.svelte:2045 cmsfieldgroup_values_binding CMSWidgetEntity.svelte:1484 ctx index.mjs:2006 cmsfield_value_binding CMSFieldGroup.svelte:523 cmsfield_value_binding CMSFieldGroup.svelte:210 ctx index.mjs:2006 switch_instance_value_binding CMSField.svelte:735 switch_instance_value_binding CMSField.svelte:180 ctx index.mjs:2006 input_change_handler CMSWidgetOptions.svelte:656 listen index.mjs:415 listen_dev index.mjs:2160 mount CMSWidgetOptions.svelte:258 mount CMSWidgetOptions.svelte:402 mount CMSWidgetOptions.svelte:543 m svelte-hooks.js:291 mount_component index.mjs:1935 mount CMSField.svelte:217 mount CMSField.svelte:96 update CMSField.svelte:647 update index.mjs:1193 flush index.mjs:1160 promise callback*schedule_update index.mjs:1118 make_dirty index.mjs:1970 ctx index.mjs:2008 cmsfieldgroup_values_binding CMSWidgetEntity.svelte:2045 cmsfieldgroup_values_binding CMSWidgetEntity.svelte:1484 ctx index.mjs:2006 cmsfield_value_binding CMSFieldGroup.svelte:523 cmsfield_value_binding CMSFieldGroup.svelte:210 ctx index.mjs:2006 switch_instance_value_binding CMSField.svelte:735 switch_instance_value_binding CMSField.svelte:180 ctx index.mjs:2006 input_change_handler CMSWidgetCheckbox.svelte:400 listen index.mjs:415 listen_dev index.mjs:2160 mount CMSWidgetCheckbox.svelte:314 m svelte-hooks.js:291 mount_component index.mjs:1935 mount CMSField.svelte:217 mount CMSField.svelte:96 mount CMSField.svelte:631 m svelte-hooks.js:291 mount_component index.mjs:1935 mount CMSFieldGroup.svelte:234 mount CMSFieldGroup.svelte:361 m svelte-hooks.js:291 mount_component index.mjs:1935 mount CMSWidgetEntity.svelte:1537 mount Modal.svelte:105 m svelte-hooks.js:291

System Info

System: OS: macOS 12.6.2 CPU: (8) x64 Apple M1 Memory: 27.68 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm Browsers: Chrome: 109.0.5414.87 Firefox: 108.0.2 Safari: 16.2 npmPackages: svelte: ^3.42.6 => 3.55.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions