Skip to content

Cannot use EventStreamProvider because ElementStream is not published. #199

@ditman

Description

@ditman

I'm trying to listen to the cancel event of an HTMLInputElement, and instead of using the .oncancel setter directly:

I'm trying to add an onCancel stream to an web.HTMLInputElement with something like the following:

extension AddOnCancelStreamToInputElement on web.HTMLInputElement {
  web.ElementStream<web.Event> get onCancel => const
    web.EventStreamProvider<web.Event>('cancel').forElement(this);
}

However, I get the following error:

Undefined class 'ElementStream'.
Try changing the name to the name of an existing class, or creating a class with the name 'ElementStream'. dart(undefined_class)

2 questions here:

  1. Can an onCancel Stream be added to the HTMLInputElement class somewhere here.
  2. and/or expose the ElementStream<T> so I can add my own with the same helpers available for package:web.

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