Skip to content

Commit

Permalink
Add strict equality checks. (WICG#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayumi Hamasaki authored and robdodson committed Jul 11, 2019
1 parent 50c1e8a commit 8b95f58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/focus-visible.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ function applyFocusVisiblePolyfill(scope) {
var type = el.type;
var tagName = el.tagName;

if (tagName == 'INPUT' && inputTypesWhitelist[type] && !el.readOnly) {
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !el.readOnly) {
return true;
}

if (tagName == 'TEXTAREA' && !el.readOnly) {
if (tagName === 'TEXTAREA' && !el.readOnly) {
return true;
}

Expand Down Expand Up @@ -180,7 +180,7 @@ function applyFocusVisiblePolyfill(scope) {
* @param {Event} e
*/
function onVisibilityChange(e) {
if (document.visibilityState == 'hidden') {
if (document.visibilityState === 'hidden') {
// If the tab becomes active again, the browser will handle calling focus
// on the element (Safari actually calls it twice).
// If this tab change caused a blur on an element with focus-visible,
Expand Down

0 comments on commit 8b95f58

Please sign in to comment.