Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error when setting non-static handler on event #993

Closed
V0d01ey opened this Issue Jul 24, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@V0d01ey
Copy link

V0d01ey commented Jul 24, 2018

This sample code gives a runtime error on event handling after setting an event handler by method
public void SetHandler(Elt el).

    [JavaScript]
    class JSUtils
    {
        public int ff = 3;

        public void SetHandler(Elt el)
        {
            el.OnMouseDown(BodyMouseDownHandler);
        }

        public void BodyMouseDownHandler(WebSharper.JavaScript.Dom.Element el, WebSharper.JavaScript.Dom.Event ev)
        {
            JS.Window.Alert("mousedown on divEl. JSUtils.ff = " + ff);
        }
    }

@Jand42 Jand42 self-assigned this Jul 30, 2018

@Jand42

This comment has been minimized.

Copy link
Member

Jand42 commented Jul 30, 2018

@V0d01ey Thanks for the report, I am looking into this.

@Jand42 Jand42 added the bug label Jul 30, 2018

@Jand42 Jand42 closed this in adae245 Jul 30, 2018

@Tarmil Tarmil added the 4.4.1.288 label Jul 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.