Skip to content

Select option value is not being set when using variables #291

@cayasso

Description

@cayasso

You can see the issue here, that instead of alerting with the property value tierrasdelcafe it is falling back alerting with Tierras del cafe which is the correct behavior when value doesn't exist.

https://svelte.technology/repl/?version=1.6.8&gist=c0a81f341a7652bbc68c129d0b0105d2

Checking the output I noticed that a line like this is missing option1.value = option1.__value in the renderMainFragment method.

I did some more investigation and found the problem at this line

Changing that line to this, resolves the issue.

if ( isBoundOptionValue ) {
    local.init.addLine( `${local.name}.value = ${local.name}.__value` );

    if (dynamic) {
          local.update.addLine( `${local.name}.value = ${local.name}.__value` );
    }
}

I have the code ready with a passing test for a pull request but wanted to consult before submitting it.

Thanks for this awesome project!

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