
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
@switch-company/sticky-focus
Advanced tools
Ensure focused element is not under a sticky element
Ensure focused element is not under a sticky bar
This plugin is written in ES2015 and available either in uncompiled form in the /lib
folder or compiled for ES5 in the /dist
folder. If your project uses babel with Webpack or Rollup, you should change the exclusion so this plugin gets compiled or force Webpack or Rollup to fetch the compiled version by using the main
entry of the package.json
file instead of the module
entry.
// .babelrc file or configuration within webpack or rollup
{
"plugins": [...],
"exclude": "node_modules/!(@switch-company)/**",
}
$ npm install @switch-company/sticky-focus
import stickyFocus from '@switch-company/sticky-focus';
const sticky = new stickyFocus({
elements,
padding
});
Name | Type | Description |
---|---|---|
elements | Array | Array of HTMLElement that are the sticky elements |
Name | Type | Description |
---|---|---|
padding | Number | Number of pixels to add between the bottom of the sticky element and the top of the focused element |
Name | Description |
---|---|
refresh() | Force recalculate the size of the sticky element. Handy if the size changes between breakpoints |
restart( elements ) | Restart listening to the focus events. Pass element if you want to restart the plugin with different elements |
stop() | Stop listening to the focus events |
update( elements ) | Change the array of elements |
FAQs
Ensure focused element is not under a sticky element
We found that @switch-company/sticky-focus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.