jakubfiala / atrament

A small JS library for beautiful drawing and handwriting on the HTML Canvas.
http://fiala.space/atrament/demo
MIT License
1.56k stars 115 forks source link

range input broken when using the library? #23

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi,

I have no idea what is going on, but when I run this code, the range selector stops working in Chrome and Firefox (it works in Edge). By "not working" I mean that in Chrome you cannot deselect the slider, and in firefox you cannot move it. This is the code:

<html>
    <head>
        <script src="/assets/js/atrament.min.js"></script>
        <style>
            canvas {
                width: 200px;
                height: 200px;
                background-color: red;
            }
        </style>
    </head>
    <body>
        <canvas></canvas>
    </body>
    <script>
        var aaa = atrament('canvas', 200, 200);
    </script>
    <form>
        <input type="range"  min="0" max="10">
    </form>
</html>

And if I remove the atrament line, then it starts working:

<html>
    <head>
        <script src="/assets/js/atrament.min.js"></script>
        <style>
            canvas {
                width: 200px;
                height: 200px;
                background-color: red;
            }
        </style>
    </head>
    <body>
        <canvas></canvas>
    </body>
</html>

I think this issue does not ocurr with the older version of the library that you use in the demo.

jakubfiala commented 7 years ago

Hey @melonista thanks for raising this. I'm finally going to have some atrament time in the next few days so I'll look into fixing this

jakubfiala commented 7 years ago

@melonista fyi this may be fixed in #24

ghost commented 7 years ago

Awesome!

ghost commented 7 years ago

Tested and working.