Skip to content
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

[grid] Cell tooltip can prevent grid from scrolling #4766

Closed
sissbruecker opened this issue Oct 17, 2022 · 1 comment · Fixed by #4819
Closed

[grid] Cell tooltip can prevent grid from scrolling #4766

sissbruecker opened this issue Oct 17, 2022 · 1 comment · Fixed by #4819
Assignees
Labels
bug Something isn't working Impact: Low regression Sometimes we make things break Severity: Minor vaadin-grid

Comments

@sissbruecker
Copy link
Contributor

Description

When scrolling the grid with a mouse wheel or trackpad a tooltip can block scrolling. After starting to scroll, the tooltip will move under the mouse cursor, after which the grid stops scrolling. After the tooltip disappears the grid continues to scroll.

Bildschirmaufnahme.2022-10-17.um.15.26.40.mov

I could reproduce this in Safari and Firefox on macOS. Was not reproducable in Chrome, as the grid seems to receive mouse events during scrolling here, which means the tooltip is moved to lower cells while scrolling.

Expected outcome

The grid should continue to scroll regardless whether the mouse cursor is over a tooltip or not.

Minimal reproducible example

    <vaadin-grid item-id-path="name">
      <vaadin-grid-selection-column auto-select frozen></vaadin-grid-selection-column>
      <vaadin-grid-tree-column frozen path="name" width="200px" flex-shrink="0"></vaadin-grid-tree-column>
      <vaadin-grid-column path="name" width="200px" flex-shrink="0"></vaadin-grid-column>
      <vaadin-grid-column path="name" width="200px" flex-shrink="0"></vaadin-grid-column>
      <vaadin-grid-column path="name" width="200px" flex-shrink="0"></vaadin-grid-column>

      <vaadin-tooltip slot="tooltip" hover-delay="500" hide-delay="500"></vaadin-tooltip>
    </vaadin-grid>

    <script type="module">
      import '@vaadin/grid/all-imports';
      import '@vaadin/tooltip';

      const grid = document.querySelector('vaadin-grid');

      grid.dataProvider = ({ parentItem, page, pageSize }, cb) => {
        // Let's have 100 root-level items and 5 items on every child level
        const levelSize = parentItem ? 5 : 100;

        const pageItems = [...Array(Math.min(levelSize, pageSize))].map((_, i) => {
          const indexInLevel = page * pageSize + i;

          return {
            name: `${parentItem ? parentItem.name + '-' : ''}${indexInLevel}`,
            children: true
          };
        });

        cb(pageItems, levelSize);
      };

      const tooltip = document.querySelector('[slot="tooltip"]');
      tooltip.generator = ({column, item}) => {
        return column && column.path && item ? `Tooltip ${column.path} ${item.name}` : '';
      };
    </script>

Steps to reproduce

  1. Add the snippet to a page
  2. Hover over a cell until the tooltip appears
  3. Scroll down using mouse wheel or trackpad

Environment

Vaadin version(s): 23.3

Browsers

Firefox, Safari

@yuriy-fix
Copy link
Contributor

Could consider pointer-events: none.

@yuriy-fix yuriy-fix added bug Something isn't working Impact: Low Severity: Minor regression Sometimes we make things break labels Oct 18, 2022
@sissbruecker sissbruecker self-assigned this Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Impact: Low regression Sometimes we make things break Severity: Minor vaadin-grid
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants