@atlaskit/layer
Advanced tools
Comparing version 5.0.4 to 5.0.5
# @atlaskit/layer | ||
## 5.0.5 | ||
- [patch] Implement left offset position to fixed-position layer [8242529](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/8242529) | ||
- [none] Updated dependencies [8242529](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/8242529) | ||
## 5.0.4 | ||
@@ -4,0 +8,0 @@ - [patch] update the dependency of react-dom to 16.4.2 due to vulnerability in previous versions read https://reactjs.org/blog/2018/08/01/react-v-16-4-2.html for details [a4bd557](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/a4bd557) |
@@ -83,3 +83,3 @@ 'use strict'; | ||
var rect = actualTarget.getBoundingClientRect(); | ||
return '\n position: fixed;\n top: ' + fixedOffset + 'px;\n height: ' + rect.height + 'px;\n width: ' + rect.width + 'px;\n z-index: -1;\n '; | ||
return '\n position: fixed;\n top: ' + fixedOffset.top + 'px;\n left: ' + fixedOffset.left + 'px;\n height: ' + rect.height + 'px;\n width: ' + rect.width + 'px;\n z-index: -1;\n '; | ||
} | ||
@@ -229,5 +229,12 @@ return 'display: none;'; | ||
var actualTarget = this.targetRef.firstChild; | ||
this.setState({ fixedOffset: actualTarget.getBoundingClientRect().top }); | ||
this.setState({ | ||
fixedOffset: { | ||
top: actualTarget.getBoundingClientRect().top, | ||
left: actualTarget.getBoundingClientRect().left | ||
} | ||
}); | ||
} else if (!isAlwaysFixed && this.state.fixedOffset !== null) { | ||
this.setState({ fixedOffset: null }); | ||
this.setState({ | ||
fixedOffset: null | ||
}); | ||
} | ||
@@ -234,0 +241,0 @@ } |
@@ -33,3 +33,3 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
var rect = actualTarget.getBoundingClientRect(); | ||
return '\n position: fixed;\n top: ' + fixedOffset + 'px;\n height: ' + rect.height + 'px;\n width: ' + rect.width + 'px;\n z-index: -1;\n '; | ||
return '\n position: fixed;\n top: ' + fixedOffset.top + 'px;\n left: ' + fixedOffset.left + 'px;\n height: ' + rect.height + 'px;\n width: ' + rect.width + 'px;\n z-index: -1;\n '; | ||
} | ||
@@ -179,5 +179,12 @@ return 'display: none;'; | ||
var actualTarget = this.targetRef.firstChild; | ||
this.setState({ fixedOffset: actualTarget.getBoundingClientRect().top }); | ||
this.setState({ | ||
fixedOffset: { | ||
top: actualTarget.getBoundingClientRect().top, | ||
left: actualTarget.getBoundingClientRect().left | ||
} | ||
}); | ||
} else if (!isAlwaysFixed && this.state.fixedOffset !== null) { | ||
this.setState({ fixedOffset: null }); | ||
this.setState({ | ||
fixedOffset: null | ||
}); | ||
} | ||
@@ -184,0 +191,0 @@ } |
{ | ||
"name": "@atlaskit/layer", | ||
"version": "5.0.3" | ||
"version": "5.0.4" | ||
} |
{ | ||
"name": "@atlaskit/layer", | ||
"version": "5.0.4", | ||
"version": "5.0.5", | ||
"description": "A React layer component responsible for the position of an element on a page", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
398169
8254
2615