Skip to content

Instantly share code, notes, and snippets.

Joni Halabi thatdevgirl

Block or report user

Report or block thatdevgirl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thatdevgirl
thatdevgirl / handle-tab-focus.js
Created Jun 20, 2019
Function that handles focus when user navigates through a site using their keyboard. Prevents the focus from getting stuck, which can sometimes happen with carousels.
View handle-tab-focus.js
function handleTabFocus(e) {
let focus = document.activeElement,
newFocus;
$(document).keyup(function(e) {
const code = e.keyCode || e.which;
// If the tab key is pressed:
if (code === 9) {
// Determine which element has focus now.
@thatdevgirl
thatdevgirl / simple-autocomplete.js
Created Nov 29, 2018
Simple Autocomplete component for WP Gutenberg
View simple-autocomplete.js
/**
* A very simple autocomplete component
*
* This is to replace the OOTB Gutenberg Autocomplete component because it is
* currently broken as of v4.5.1.
*
* See Github issue: https://github.com/WordPress/gutenberg/issues/10542
*
* Note: The options array should be an array of objects containing labels and values; i.e.:
* [
You can’t perform that action at this time.