Skip to content

🐛 BUG: Using .map() inside a <select> strips subsequent markup #340

@andrewborstein

Description

@andrewborstein

What version of astro are you using?

0.25.0-next.3

What package manager are you using?

npm

What operating system are you using?

Stackblitz

Describe the Bug

Including a .map() inside a <select> inside a .astro file breaks all subsequent markup after the <select> (except the <option> tags). The Stackblitz includes comments and other examples that illustrate the example well: https://stackblitz.com/edit/github-39j8qw?file=src%2Fpages%2Findex.astro&on=stackblitz

Including this

<select>
  {[1, 2, 3].map(num => <option>{num}</option>)} 
</select>

Anywhere in index.astro will strip all the markup that follows it except the <option> tags, but the leave the text in tact. It doesn't break the whole page, so if you move it to the bottom of the page, nothing will be broken.

Screen Shot 2022-03-25 at 6 29 52 PM Screen Shot 2022-03-25 at 6 29 34 PM

Screen Shot 2022-03-25 at 6 31 51 PM

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-39j8qw?file=src%2Fpages%2Findex.astro&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.

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