Skip to content

Phantom pattern on reused input field #122

@grmble

Description

@grmble

When switching between two forms, if the structure of the HTML is similiar enough, the virtual DOM will reuse the existing input elements and change the properties/attributes around.

Attributes that do not exist in the current version don't seem to get removed, but they are assigned null value. A required property will be false, a number property will be 0. String properties get the empty string. Empty pattern strings don't validate though. So you end up with a phantom pattern on your input field that will prevent validation.

The problem shows up in current Firefox and Chrome.

A simple example that shows the problem when cut and pasted to elm-lang.org/try

https://gist.github.com/grmble/c15e9258a90e1a8bfb9417cae6d0af55

If you click "Show Demo 2" and then "Show Demo 1", the input field has a permanent red border.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions