Skip to content

Commit

Permalink
Release 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wnr committed Feb 20, 2021
1 parent 5f695d4 commit 1794c5d
Show file tree
Hide file tree
Showing 5 changed files with 8,042 additions and 36 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ Please note that both approaches have been heavily reworked for better performan

## Changelog

#### 1.2.2

* Fixes scroll strategy to account for elements within shadow root. See #127.
* Fix potential contenteditable bugs with object approach. See #122.

#### 1.2.1

A release that includes 1.1.15 and 1.1.16 with 1.2.0.
Expand Down
7 changes: 4 additions & 3 deletions dist/element-resize-detector.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* element-resize-detector 1.2.1
* element-resize-detector 1.2.2
* Copyright (c) 2016 Lucas Wiener
* https://github.com/wnr/element-resize-detector
* Licensed under MIT
Expand Down Expand Up @@ -296,7 +296,7 @@ module.exports = function(options) {
var debug = options.debug;

function injectObject(element, callback) {
var OBJECT_STYLE = buildCssTextString(["display: block", "position: absolute", "top: 0", "left: 0", "width: 100%", "height: 100%", "border: none", "padding: 0", "margin: 0", "opacity: 0", "z-index: -1000", "pointer-events: none"]);
var OBJECT_STYLE = buildCssTextString(["display: block", "position: absolute", "top: 0", "left: 0", "width: 100%", "height: 100%", "border: none", "padding: 0", "margin: 0", "opacity: 0", "z-index: -1000", "pointer-events: none", "visibility: hidden"]);

//The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.

Expand Down Expand Up @@ -649,7 +649,8 @@ module.exports = function(options) {

function isDetached(element) {
function isInDocument(element) {
return element === element.ownerDocument.body || element.ownerDocument.body.contains(element);
var isInShadowRoot = element.getRootNode && element.getRootNode().contains(element);
return element === element.ownerDocument.body || element.ownerDocument.body.contains(element) || isInShadowRoot;
}

if (!isInDocument(element)) {
Expand Down

0 comments on commit 1794c5d

Please sign in to comment.