Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
accessible-navigation
Advanced tools
A pub/sub observer that handles keyboard navigation for tabs, accordions and menus.
A pub/sub observer that handles keyboard navigation for tabs, accordions and menus.
This solution bundles the appropriate arrow navigation keys. It relies on
browser native support for keyboard Tab, Shift+Tab as well as Enter and Spacebar
behavior from HTML <button />
elements.
The drive behind the concept was to make the browser work smarter not harder. Leveraging everything we get natively for free from the browser and then add only the support that is missing. The solution abstracts away the functionality from the component to simplify usage.
This solution currently recommends and supports native HTML button elements to get full access to the appropriate supported keyboard events.a
TODO: Confirm tag support
A pub/sub class observer that monitors the elements provided to handle the keyboard events.
subscribe
- A method that takes a unique label
and element
arguments to
construct elements that are subscribed to the navigation events.unsubscribe
- A method that takes the unique label
as an argument and
unsubscribes from the item being observed.update
- A method that takes two arguments the event
and label
arguments. These trigger the navigation event. Recommended to be used with
onKeyDown
.view
- A method used for console logging the elements being observed.import { createKeyboardNav, KeyboardNav } from 'aria-keyboard-a11y'
const tabs = KeyboardNav('horizontal')
const useKeyboardNav = createKeyboardNav(tabs)
function Tab({ label, title, setActiveTabs, isSelected = false, index = 0 }) {
function handleKeyDown(event) {
tabs.update(event, label)
}
const refs = useKeyboardNav(label)
return (
<>
<button
ref={refs}
className={`tab ${isSelected ? 'isSelected' : ''}`}
type="button"
onClick={handleClick}
role="tab"
aria-selected={isSelected}
aria-controls={`tabpanel-${index}`}
id={`tab-${index}`}
onKeyDown={handleKeyDown}
>
{title}
</button>
</>
)
}
FAQs
A pub/sub observer that handles keyboard navigation for tabs, accordions and menus.
We found that accessible-navigation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.