Skip to content

events triggered by calls into CodeMirror should be delivered asynchronously #70

@skybrian

Description

@skybrian

mirror.onEvent("focus", false) returns a stream of events that happens whenever CodeMirror gets focus.

Calling mirror.focus() causes an event to be delivered synchronously (in the middle of the focus call). This isn't normal behavior for a Dart stream; usually events are delivered asynchronously (such as in a microtask).

#6      _RootZone.runUnaryGuarded (dart:async/zone.dart:1087)
#7      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#8      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#9      _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:381)
#10     _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:256)
#11     JsEventListener.stream.<anonymous closure>.<anonymous closure> (package:codemirror/src/js_utils.dart:62:27)
#12     JsObject._callMethod (dart:js:1132)
#13     JsObject.callMethod (dart:js:1071)
#14     ProxyHolder.call (package:codemirror/codemirror.dart:1207:46)
#15     CodeMirror.focus (package:codemirror/codemirror.dart:348:19)

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