@vaadin/component-base
Advanced tools
Comparing version 24.6.4 to 24.6.5
{ | ||
"name": "@vaadin/component-base", | ||
"version": "24.6.4", | ||
"version": "24.6.5", | ||
"publishConfig": { | ||
@@ -41,8 +41,8 @@ "access": "public" | ||
"devDependencies": { | ||
"@vaadin/chai-plugins": "~24.6.4", | ||
"@vaadin/test-runner-commands": "~24.6.4", | ||
"@vaadin/chai-plugins": "~24.6.5", | ||
"@vaadin/test-runner-commands": "~24.6.5", | ||
"@vaadin/testing-helpers": "^1.1.0", | ||
"sinon": "^18.0.0" | ||
}, | ||
"gitHead": "02d8ac2c39bc2d27fe60acec7d7bac6bdb73d8a1" | ||
"gitHead": "fc109a4234a1f60e89717ab1c0dc8fb4451aa418" | ||
} |
@@ -16,3 +16,3 @@ /** | ||
export function defineCustomElement(CustomElement, version = '24.6.4') { | ||
export function defineCustomElement(CustomElement, version = '24.6.5') { | ||
Object.defineProperty(CustomElement, 'version', { | ||
@@ -19,0 +19,0 @@ get() { |
@@ -55,2 +55,16 @@ /** | ||
const attachObserver = new ResizeObserver(([{ contentRect }]) => { | ||
const isHidden = contentRect.width === 0 && contentRect.height === 0; | ||
if (!isHidden && this.__scrollTargetHidden && this.scrollTarget.scrollTop !== this._scrollPosition) { | ||
// When removing element from DOM, its scroll position is lost and | ||
// virtualizer doesn't re-render when adding it to the DOM again. | ||
// Restore scroll position when the scroll target becomes visible, | ||
// which is the case e.g. when virtualizer is used inside a dialog. | ||
this.scrollTarget.scrollTop = this._scrollPosition; | ||
} | ||
this.__scrollTargetHidden = isHidden; | ||
}); | ||
attachObserver.observe(this.scrollTarget); | ||
this._scrollLineHeight = this._getScrollLineHeight(); | ||
@@ -57,0 +71,0 @@ this.scrollTarget.addEventListener('wheel', (e) => this.__onWheel(e)); |
221335
6520