mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 19:26:04 +03:00
remove resizeobserver code
seems to cause more harm than good in some cases and we shouldn't need it if we get our calls to onHeightChanged in order.
This commit is contained in:
parent
89b044f5d8
commit
98a3f7db0f
1 changed files with 0 additions and 26 deletions
|
@ -79,26 +79,6 @@ if (DEBUG_SCROLL) {
|
||||||
* offset as normal.
|
* offset as normal.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function createTimelineResizeDetector(scrollNode, itemlist, callback) {
|
|
||||||
if (typeof ResizeObserver !== "undefined") {
|
|
||||||
const ro = new ResizeObserver(callback);
|
|
||||||
ro.observe(itemlist);
|
|
||||||
return ro;
|
|
||||||
} else if (typeof IntersectionObserver !== "undefined") {
|
|
||||||
const threshold = [];
|
|
||||||
for (let i = 0; i <= 1000; ++i) {
|
|
||||||
threshold.push(i / 1000);
|
|
||||||
}
|
|
||||||
const io = new IntersectionObserver(
|
|
||||||
callback,
|
|
||||||
{root: scrollNode, threshold},
|
|
||||||
);
|
|
||||||
io.observe(itemlist);
|
|
||||||
return io;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'ScrollPanel',
|
displayName: 'ScrollPanel',
|
||||||
|
|
||||||
|
@ -181,12 +161,6 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
this.checkScroll();
|
this.checkScroll();
|
||||||
|
|
||||||
this._timelineSizeObserver = createTimelineResizeDetector(
|
|
||||||
this._getScrollNode(),
|
|
||||||
this.refs.itemlist,
|
|
||||||
() => { this._restoreSavedScrollState(); },
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidUpdate: function() {
|
componentDidUpdate: function() {
|
||||||
|
|
Loading…
Reference in a new issue