Skip to content

Warning "no onClicked" when button component is used with @type="submit" and no click handler #354

Open
@neojp

Description

@neojp

Expected Behavior

Do not send a missing this.args.onClicked warning if component is used as button[type=submit].

Actual Behavior

A warning is sent for a missing this.args.onClicked function even if it's not necessary.

if(!this.args.onClicked) {
// eslint-disable-next-line no-console
console.warn(new Error('Button created with no onClicked'));
} else {
this._onClicked = this.args.onClicked;
}

Steps to Reproduce

Add an es-button component with @type=submit and no @onClicked.

<EsButton @type="submit" @label="Search" />

Screenshot

image

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