Skip to content

"Unable to find element" error on <option> elements #2620

Closed
@mmavko

Description

@mmavko

If the contents of the <option> element is constructed in special way, it breaks React on component update with "Unable to find element" error. Here's an example of render method body:

    var v1 = String(Math.random());
    var v2 = String(Math.random());
    return <select><option value={v2}>{v1} ({v2})</option></select>;

Here's working jsfiddle (with React 0.12.0): http://jsfiddle.net/rp3fz0nf/1/

Adding key={v2} to option props fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions