New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

redraw-dom

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redraw-dom

Forces the browser to synchronously redraw a DOM node.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

redraw-dom

Forces the browser to synchronously redraw a DOM node.

Anytime you've got some weird bug with the browsing not updatig the look of your element, you might need to force a repaint/redraw. This snippet will do the trick!

Before using this, you might want to try the backface-visibility: hidden; hack or using will-change (as seen here) since this is the "official" way to go.

API

  • redraw(el, display) redraw the el element (must be a DOM node). display is the display style you want restored on the element (defaults to block).

Example

var redraw = require('redraw-dom');

var el = document.querySelector('.el-redraw');
redraw(el);

el.style.display = 'inline';
redraw(el, 'inline'); // Preserve the inline display

Keywords

dom

FAQs

Package last updated on 02 Jul 2015

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