Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-focus and ng-blur does not work on <button> element under Safari and FF browsers #13761

Open
Kamilius opened this issue Jan 13, 2016 · 7 comments

Comments

@Kamilius
Copy link

Can't get ng-focus and ng-blur directives working on button element under Safari and FF browsers.

Here is an example to visually reproduce this issue:

<div ng-app ng-init="focus=false;blur=false;active=false">
  <button
    tabindex="1" 
    ng-class="{ myFocus: focus, myBlur: blur }"    
    ng-focus="focus=true;blur=false;" 
    ng-blur="blur=true;focus=false;"
    value="Click me"
  >
    Click me
  </button>

  <p>focus: {{focus}}</p>
  <p>blur: {{blur}} </p>
</div>

Working example from above can be found here:
http://jsfiddle.net/UTn5y/1196/

Generally using this approach to write a dropdown. Button is used as dropdown list toggle.

@Narretz
Copy link
Contributor

Narretz commented Jan 13, 2016

Works for me in FF. Which version are you using?

@Kamilius
Copy link
Author

@Narretz was under 42, but now updated to 43.0.4. Still doesn't work under FF MacOS

@Narretz
Copy link
Contributor

Narretz commented Jan 13, 2016

Then it's probably a MacOs thing ...

@Narretz
Copy link
Contributor

Narretz commented Jan 13, 2016

See https://gist.github.com/cvrebert/68659d0333a578d75372

So it looks like FF and Safari have independent bugs, because it works in Chrome.

Would you like to open bugs for Safari and FF about this?

@Kamilius
Copy link
Author

@Narretz I believe I do, if there are none regarding this issue. Thanks for help then.

@swarndeepkumar
Copy link

@Narretz Are you still facing same issue in FF ?

@pidj
Copy link

pidj commented Jul 9, 2018

Personnally, I'm still facing the issue under Safari 11.1 on macOS High Sierra... :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants