Socket
Socket
Sign inDemoInstall

@coffeekraken/s-refocus-feature

Package Overview
Dependencies
636
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @coffeekraken/s-refocus-feature

Small feature that you can apply on your scroll elements and will refocus it depending on triggers like an event, the url anchor, etc...


Version published
Maintainers
1
Created

Readme

Source

{{#> layout-readme }}

Simply refocus elements inside a scrollable one.

This SRefocusFeature feature allows you to simple visually refocus an element inside a scrollable one. Here's some of the features available:

  • Declarative API like <div s-refocus on="eventName">...</div>
  • Fully customizable scroll behavior
  • Specify triggerers like:
    • anchor: Scroll to the element that correspond to the anchor in url
    • history: Listen for change in history and scroll to element if needed
    • event:eventName: Specify an event to listen to. When an element dispatch this element, scroll to it

Usage

Here's how to use our implementation:

import { define } from '@coffeekraken/s-refocus-feature';
define({
    // default props
});

Consider the url http://localhost:my-anchor

<div class="my-scrollable-div" s-refocus trigger="anchor,history,event:actual">
    <ul>
        <!-- some list items... -->
        <li id="my-anchor">...</li>
        <!-- some list items... -->
    </ul>
</div>
Properties

{{> interface namespace='@coffeekraken.s-refocus-feature.js.interface.SRefocusFeatureInterface' }}

{{/ layout-readme }}

FAQs

Last updated on 18 Aug 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc