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

Fix Mouse.isDown behavior for non-fullscreen components #498

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@erich-9

erich-9 commented Feb 6, 2016

The signal Mouse.isDown doesn't work as explained in the documentation:

True when any mouse button is down, and false otherwise.

For embedded components pressing or releasing a mouse button outside the component doesn't change the value of the signal Mouse.isDown, even if the mouse is moved back into the component afterwards.

Here is an example (save it as Main.elm and compile elm-make Main.elm --output=elm.js):

module Main (main) where

import Graphics.Element exposing (show)
import Mouse

main = Signal.map show Mouse.isDown

Now embed it in an HTML document:

<html>
  <head>
  <style>
    div.fbox { width: 50px; height: 50px; border: solid gray 2px }
  </style>
  </head>
  <body>
    <div id="x" class="fbox"></div>
    <script src="elm.js"></script>
    <script>
      var x = document.getElementById('x');
      Elm.embed(Elm.Main, x);
    </script>
  </body>
</html>
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

Mouse no longer lives in core. Not sure if it is still an issue in elm-lang/mouse.

Member

evancz commented May 11, 2016

Mouse no longer lives in core. Not sure if it is still an issue in elm-lang/mouse.

@evancz evancz closed this May 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment