-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Remove skip link focus fix from Twenty Twenty-One #10913
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
Closed
sabernhardt
wants to merge
5
commits into
WordPress:trunk
from
sabernhardt:t21-remove-ie-skip-link-fix
+8
−53
Closed
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ddcdafd
Remove contents of `skip-link-focus-fix.js`
sabernhardt 8e3ad28
Update function output and documentation
sabernhardt ceedd94
add function name to HTML comment
sabernhardt 030f208
Remove contents from `ie-editor.css.map`
sabernhardt 471d989
Merge branch 'trunk' into t21-remove-ie-skip-link-fix
sabernhardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 1 addition & 35 deletions
36
src/wp-content/themes/twentytwentyone/assets/js/skip-link-focus-fix.js
This file contains hidden or 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 |
|---|---|---|
| @@ -1,35 +1 @@ | ||
| /** | ||
| * File skip-link-focus-fix.js. | ||
| * | ||
| * Helps with accessibility for keyboard only users. | ||
| * | ||
| * This is the source file for what is minified in the twenty_twenty_one_skip_link_focus_fix() PHP function. | ||
| * | ||
| * Learn more: https://git.io/vWdr2 | ||
| * | ||
| * @since Twenty Twenty-One 1.0 | ||
| */ | ||
| ( function() { | ||
| var isIe = /(trident|msie)/i.test( navigator.userAgent ); | ||
|
|
||
| if ( isIe && document.getElementById && window.addEventListener ) { | ||
| window.addEventListener( 'hashchange', function() { | ||
| var id = location.hash.substring( 1 ), | ||
| element; | ||
|
|
||
| if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { | ||
| return; | ||
| } | ||
|
|
||
| element = document.getElementById( id ); | ||
|
|
||
| if ( element ) { | ||
| if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { | ||
| element.tabIndex = -1; | ||
| } | ||
|
|
||
| element.focus(); | ||
| } | ||
| }, false ); | ||
| } | ||
| }() ); | ||
| // Internet Explorer support was removed. |
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.