Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@zendeskgarden/container-focusjail
Advanced tools
Containers relating to focusjail in the Garden Design System
This package includes containers relating to focus looping in the Garden Design System.
npm install @zendeskgarden/container-focusjail
This container implements the dialog focus loop design pattern and can be used to build a modal component. Check out storybook for live examples.
The useFocusJail
hook allows you to trap focus to a container element. Useful
for modals and widgets. Garden uses this in react-components for the modals package.
import { useRef } from 'react';
import { useFocusJail } from '@zendeskgarden/container-focusjail';
const FocusJail = () => {
const containerRef = useRef(null);
const { getContainerProps } = useFocusJail({
focusOnMount: false,
environment: window.parent.document,
containerRef
});
return (
<>
<input />
<div {...getContainerProps({ ref: containerRef, tabIndex: -1 })}>
<p>Focus is locked within the parent element</p>
<input />
<button>Focusable Items</button>
</div>
</>
);
};
FocusJailContainer
is a render-prop wrapper for the useFocusJail
hook.
import { createRef } from 'react';
import { FocusJailContainer } from '@zendeskgarden/container-focusjail';
const containerRef = createRef(null);
<FocusJailContainer
containerRef={containerRef}
focusOnMount={false}
environment={window.parent.document}
>
{({ getContainerProps }) => (
<>
<input />
<div {...getContainerProps({ ref: containerRef, tabIndex: -1 })}>
<p>Focus is locked within the parent element</p>
<input />
<button>Focusable Items</button>
</div>
</>
)}
</FocusJailContainer>;
FAQs
Containers relating to focusjail in the Garden Design System
We found that @zendeskgarden/container-focusjail demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.