rtfeldman/dreamwriter

Slow editor scrolling

Opened this issue · 0 comments

Scrolling in the editor is much slower than expected. Watching the timeline, it appears there's an event handler in the Elm runtime that fires on scroll events, which in turn is triggering repaints.

dreamwriter-scroll-timeline

The relevant (generated) code:

function createHandler(eventName, delegator) {
    var globalListeners = delegator.globalListeners;
    var delegatorTarget = delegator.target;

    return handler

    function handler(ev) {
        var globalHandlers = globalListeners[eventName] || []

        if (globalHandlers.length > 0) {
            var globalEvent = new ProxyEvent(ev);
            globalEvent.currentTarget = delegatorTarget;
            callListeners(globalHandlers, globalEvent)
        }

        findAndInvokeListeners(ev.target, ev, eventName)
    }
}