-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual List rendering issue in Popover #8630
Labels
Comments
RenderingIssue.mp4 |
Could be related to #6431, see especially #6431 (comment) |
Reproduced with the web component using the following example: <button>Open</button>
<vaadin-dialog></vaadin-dialog>
<script type="module">
import '@vaadin/dialog';
import '@vaadin/virtual-list';
const dialog = document.querySelector('vaadin-dialog');
dialog.renderer = (root) => {
if (!root.firstChild) {
const items = Array.from({ length: 100000 }).map((_, i) => {
return { label: `Item ${i}` };
});
const renderer = (root, _, { item }) => {
root.innerHTML = `<div>${item.label}</div>`;
};
const list = document.createElement('vaadin-virtual-list');
list.style.height = '300px';
list.items = items;
list.renderer = renderer;
root.appendChild(list);
}
}
document.querySelector('button').addEventListener('click', () => {
dialog.opened = true;
});
</script> Steps to reproduce:
|
UPD: this seems related to the <button>Move to body</button>
<div>
<vaadin-virtual-list style="height: 400px" data-overlay></vaadin-virtual-list>
</div>
<script type="module">
import '@vaadin/virtual-list';
const items = Array.from({ length: 100000 }).map((_, i) => {
return { label: `Item ${i}` };
});
const renderer = (root, _, { item }) => {
root.innerHTML = `<div>${item.label}</div>`;
};
const list = document.querySelector('vaadin-virtual-list');
list.items = items;
list.renderer = renderer;
const div = document.querySelector('div');
const button = document.querySelector('button');
button.addEventListener('click', () => {
if (list.hasAttribute('data-overlay')) {
// Teleport to body
list.removeAttribute('data-overlay');
document.body.appendChild(list);
button.textContent = 'Move to div';
} else {
// Teleport to div
list.setAttribute('data-overlay', '');
div.appendChild(list);
button.textContent = 'Move to body';
}
});
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When a Virtual List is added inside a Popover component and the list is scrolled to end, then on closing and re opening the Popover, the virtual list is blank and appears only when scrolled.
Expected outcome
The Virtual List should appear without the initial scrolling.
Minimal reproducible example
Steps to reproduce
Environment
Vaadin version(s): 24.6.4
Browsers
No response
The text was updated successfully, but these errors were encountered: