Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

focus-options-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

focus-options-polyfill

JavaScript polyfill for the WHATWG spec of focusOptions, that enables a set of options to be passed to the focus method.

  • 1.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38K
decreased by-15.49%
Maintainers
1
Weekly downloads
 
Created
Source

focus-options-polyfill

npm version

JavaScript polyfill for focusOptions, an optional property passed to HTMLElement.focus() that contains the preventScroll boolean, which controls whether the browser should prevent a focused element from being scrolled into view.

Current support

https://caniuse.com/#feat=mdn-api_htmlelement_focus_preventscroll_option

Docs

Intents to implement

document.scrollingElement

This polyfill uses a basic fallback for the document.scrollingElement property, using document.documentElement when not found.

This could suffice in basic cases, but if you need wider and/or specific support you should refer to a polyfill for it:

Also, to overcome its absence if you are executing this polyfill through jsdom, you could place this in your setup:

document.scrollingElement = document.documentElement

More context about this property can be found in:

Dev and testing

To check this polyfill you can do:

npm run dev

to launch a small page that will check browser/polyfill behaviour.

Keywords

FAQs

Package last updated on 05 Sep 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc