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
Critical bugs masthead nav #764
Merged
RCopeland
merged 4 commits into
sparkdesignsystem:staging
from
RCopeland:critical-bugs-masthead-nav
Nov 2, 2018
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
89231e6
updated masthead line color, refactored styling, polyfill for focus-w…
RCopeland e4f70f1
fixed tab bug with home / end keys
RCopeland e9d29d1
Merge remote-tracking branch 'upstream/staging' into critical-bugs-ma…
RCopeland b5fd8b1
removing polyfill
RCopeland File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* eslint-disable */ | ||
(function(window, document){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we convert this to ES6 to match the rest of our JS? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ended up removing the polyfill |
||
'use strict'; | ||
var slice = [].slice; | ||
var removeClass = function(elem){ | ||
elem.classList.remove('sprk-u-FocusWithin'); | ||
}; | ||
var update = (function(){ | ||
var running, last; | ||
var action = function(){ | ||
var element = document.activeElement; | ||
running = false; | ||
if(last !== element){ | ||
last = element; | ||
slice.call(document.getElementsByClassName('sprk-u-FocusWithin')).forEach(removeClass); | ||
while(element && element.classList){ | ||
element.classList.add('sprk-u-FocusWithin'); | ||
element = element.parentNode; | ||
} | ||
} | ||
}; | ||
return function(){ | ||
if(!running){ | ||
requestAnimationFrame(action); | ||
running = true; | ||
} | ||
}; | ||
})(); | ||
document.addEventListener('focus', update, true); | ||
document.addEventListener('blur', update, true); | ||
update(); | ||
})(window, document); | ||
/* eslint-enable */ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yodasw16 @afebbraro Do you guys think its worth it to load a polyfill for this?
If I dont, then in IE / Edge, when a user tabs into a wide-nav item's submenu, the wide-nav item wont be marked active. Mouse use is fine, this would only affect keyboard only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They will still be able to see which submenu item they are currently on? If so, the submenu being visually under the main item should be enough to indicate which one is active. Unless I'm misunderstanding.
On the other hand, the polyfill is tiny (< 1k).