Skip to content

Support default values (or programatic population of values) on input fields #14

Description

@deweydb

Right now this script just takes the input placeholder by default, even if the input has value="" set to something.

I changed:
this.toggle.innerHTML = this.elOriginal.getAttribute( 'placeholder' );

to:
this.toggle.innerHTML = this.elOriginal.value.trim() !== '' ? this.elOriginal.value : this.elOriginal.getAttribute( 'placeholder' );

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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