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

drab-blur doesnt work #138

Closed
dokuzbir opened this issue May 31, 2018 · 1 comment
Closed

drab-blur doesnt work #138

dokuzbir opened this issue May 31, 2018 · 1 comment

Comments

@dokuzbir
Copy link

dokuzbir commented May 31, 2018

Drab-change works as usual with that code. But when i try to use drab-blur nothing happens.

<input drab-blur="show_log" class="form-control" id="drab-example">

  defhandler show_log(socket, sender) do
    IO.inspect("I am working")
  end

Event works when i try in javascript so there is no problem with browser or javascript

  document.querySelector("#drab-example").addEventListener("blur", function(){
    alert("I am working")
  })
@grych
Copy link
Owner

grych commented May 31, 2018

Hi @dokuzbir,
this is expected, see the documentation.

drab-event="handler" is the shorthand for more elaborate form, drab="event:handler", and by default it is set only for a few most popular events, and blur is not on the list.

So if you are using blur many times, you might add it to :events_shorthands config. Or just use:

<input drab="blur:show_log" class="form-control" id="drab-example">

@grych grych closed this as completed May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants