ag-grid / ag-grid

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.
http://www.ag-grid.com
Other
12.74k stars 1.87k forks source link

Tooltip in cell or header causes table to hide while tooltip is displayed #8867

Open r2musings opened 1 month ago

r2musings commented 1 month ago

I'm submitting a ... (check one with "x")

[] bug report => see 'Providing a Reproducible Scenario'
[] feature request => do not use Github for feature requests, see 'Customers of AG Grid'
[x] support request => see 'Requesting Community Support'

Not sure yet if a bug or maybe I am specifying something incorrectly, but I am seeing the grid when I mouseover any cell or header that I have a tooltip defined for. See video.

Here is what I have:

const shipmentReportsColumnDefinitions: ColDef[] = [
      {
        colId: 'deviceId',
        field: 'deviceId',
        headerName: this.translocoService.translate('DEVICE'),
        headerTooltip: 'Device header Tooltip',
        width: 175,
        flex: 2,
        tooltipValueGetter: (p: any) => {
          return 'Test Tooltip from Device data cell';
        },
      },
//.....snipped other cols without tooltips ];
<div class="ag-theme-quartz-dark">
            <ag-grid-angular
              [rowData]="descendingShipmentReports()"
              [columnDefs]="shipmentReportsColumnDefinitions"
              style="height: 90%; width: 100%"
            />
          </div>

Current behavior

If you mouseover any cell or header that has the tooltip defined, the grid disappears until you mouse away from that cell/header. In the video, my cursor is not showing but you can see the hover over the rows and you can see when the tooltip shows. The only header/data that I have tooltip defined in the videos is the deviceId column for demonstration purposes. I can hold my mouse over the header and when the tooltip times out, the grid reappears.

https://github.com/user-attachments/assets/9a715bbf-39b4-4827-8640-25dbe894e3a8

Expected behavior

Tooltip to show and not refresh/hide the grid while the tooltip is shown.

Please tell us about your environment:

Windows 10, VS Code, npm, localhost

r2musings commented 1 month ago

If anyone comes across this and has the same issue, I resolved by handling the tooltips myself like this:

const shipmentReportsColumnDefinitions: ColDef[] = [
      {
        colId: 'deviceId',
        field: 'deviceId',
        headerName: this.translocoService.translate('DEVICE'),
        headerComponentParams: {
          template: `<span title="${this.translocoService.translate('DEVICE')}">
                        ${this.translocoService.translate('DEVICE')}
                     </span>`,
        },
        width: 175,
        flex: 2,
        cellRenderer: (p: any) => {
          return `<span title='${this.translocoService.translate('DEVICE')}: ${p.data.deviceId}'>
                      ${p.data.deviceId}
                  </span>`;
        },
      },
//...more defs
];