resize-observer

Polyfills the ResizeObserver API.

APACHE-2.0 License

Downloads
15.7M
Stars
961
Committers
6

Bot releases are hidden (Show)

resize-observer - v3.4.0 Latest Release

Published by TremayneChrist about 2 years ago

Aligns polyfill with spec changes.

Initial value of lastReportedSize changed from 0, 0 to -1, -1 allowing for consistent notifications to be triggered when an element is observed for the first time.

const el = document.createElement('div');
const ro = new ResizeObserver(() => { ... });
ro.observe(el); // Will now notify with size `0, 0`.

https://github.com/w3c/csswg-drafts/issues/3664#issuecomment-1218270926

resize-observer - v4.0.0-4

Published by TremayneChrist about 3 years ago

  • Removes memory leak potential
  • Adds back capture phase for events
resize-observer - v4.0.0-3

Published by TremayneChrist about 3 years ago

  • Improves event detection in nested documents
  • Adds export map
resize-observer - v4.0.0-2

Published by TremayneChrist about 3 years ago

  • Rollup both ESM and UMD bundles
resize-observer - v4.0.0-1

Published by TremayneChrist about 3 years ago

  • Initial support for Shadow DOM and other documents
  • Add touch events
  • Fixes UMD build - Thanks @trusktr!
resize-observer - v3.3.1

Published by TremayneChrist over 3 years ago

  • Fixes an issue where isElement sometimes returns false on elements within an iFrame. Thanks @JayaKrishnaNamburu!
resize-observer - v3.3.0

Published by TremayneChrist over 3 years ago

  • Reports readonly ResizeObserverSize[] to the observer callback
  • Exposes ResizeObserverSize
resize-observer - v3.2.0

Published by TremayneChrist over 4 years ago

  • Fixes issue where calling disconnect would prevent the observer from being used to observe again (#104).
  • Uses time instead of frame counts to capture certain events.
  • Replaces Map with WeakMap
resize-observer - v3.1.3

Published by TremayneChrist over 4 years ago

  • Fixes issue with older versions of chromium.
    No notifications were fired due to differences in MutationObserver implementation.

Tested:
Chromium 45.0.2454.0 (64-bit)

resize-observer - v3.1.2

Published by TremayneChrist over 4 years ago

  • Add missing device-pixel-content-box option to readme.
resize-observer - v3.1.1

Published by TremayneChrist over 4 years ago

  • Fixes issue where elements observed inside of an IFrame could not be unobserved.
resize-observer - v3.1.0

Published by TremayneChrist over 4 years ago

  • Support observing elements from other documents (#97)
  • Adds ResizeObserverEntry.toJSON()
const elFromIFrame = iframe.contentDocument.querySelector('body');
const ro = new ResizeObserver(() => {
 ...
});
ro.observe(elFromIFrame);
resize-observer - v3.0.2

Published by TremayneChrist almost 5 years ago

  • Removed next tag
  • Tagged in npm as latest
resize-observer - v3.0.1

Published by TremayneChrist almost 5 years ago

  • Improved readme
resize-observer - v3.0.0

Published by TremayneChrist almost 5 years ago

Updates library to follow the latest specification. This includes some breaking changes from 2.x.

Breaking changes from 2.x:

  • Updates ResizeObserverEntry to return a sequence of sizes, for future fragment support (#84)
  • Removes default exports and now returns ResizeObserver and ResizeObserverEntry

Notable improvements:

  • Adds UMD bundle for SSR and other CJS loaders (Jest)
  • Adds new box option device-pixel-content-box (#85)
  • Observes CSS box of root SVG elements (#72)

Other improvements:

  • Fix circular dependency - thanks @kei-ito!
  • Fix this rewritten to undefined warning in rollup.
resize-observer - v3.0.0-3

Published by TremayneChrist almost 5 years ago

  • Fixes bug where root SVG nodes were seen to be children and children were seen to be root nodes.
resize-observer - v3.0.0-2

Published by TremayneChrist almost 5 years ago

  • Updates ResizeObserverEntry to return a sequence of sizes

BREAKING CHANGE:
Arrays are returned for contentBoxSize, borderBoxSize, and devicePixelContentBoxSize.

//entry
{
  contentRect: { ... },
  contentBoxSize: [{ inlineSize: number, blockSize: number }],
  ...
}
resize-observer - v3.0.0-1

Published by TremayneChrist almost 5 years ago

  • Observes CSS box of root SVG nodes
  • Documentation - removes default imports/exports
resize-observer - v3.0.0-0

Published by TremayneChrist almost 5 years ago

  • Removes default exports
  • Only exports exposable modules ResizeObserver and ResizeObserverEntry
  • Adds UMD bundle for legacy support

BREAKING CHANGE:
You must now use named exports.

import { ResizeObserver } from '@juggle/resize-observer';
resize-observer - v2.5.0

Published by TremayneChrist almost 5 years ago

  • Adds type=module to package.json.
  • Adds types field to package.json to explicitly locate declaration files.
  • Improves TypeScript usage, when setting observer box option.
  • Improvements to readme.