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

[Timebox] Cropped Cells Hover Border on Object Table #5658

Open
Bonapara opened this issue May 29, 2024 · 1 comment · May be fixed by #6014
Open

[Timebox] Cropped Cells Hover Border on Object Table #5658

Bonapara opened this issue May 29, 2024 · 1 comment · May be fixed by #6014
Assignees
Labels
good for experienced contributor scope: front Issues that are affecting the frontend side only size: hours

Comments

@Bonapara
Copy link
Member

Bonapara commented May 29, 2024

Current Behavior

In their hover state, the first row cells' borders in any object list are cropped by the table header. This happens because the sticky header on scroll causes a CSS z-index conflict.

CleanShot 2024-05-29 at 17 37 03

Desired Behavior

We should introduce a JS script to display the cell hover border above the navbar when no scroll is detected.

We should prioritize performance and keep the script as lightweight as possible.

CleanShot 2024-05-29 at 17 37 40

@Bonapara Bonapara added scope: front Issues that are affecting the frontend side only size: hours good for experienced contributor labels May 29, 2024
Copy link

greptile-apps bot commented May 29, 2024

Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :).

To fix the cropped cells under the sticky table header, follow these steps:

  1. Adjust CSS for z-index:

    • Locate the CSS file for the table header, likely in src/components/TableHeader.css.
    • Increase the z-index of the sticky header to ensure it stays above the cells.
    .table-header {
        position: sticky;
        top: 0;
        z-index: 1000; /* Adjust as necessary */
    }
  2. JavaScript for Hover State:

    • Add a JavaScript script to handle the hover state of the cells when no scroll is detected. This can be done in src/components/Table.js.
    document.addEventListener('DOMContentLoaded', function() {
        const tableCells = document.querySelectorAll('.table-cell');
        tableCells.forEach(cell => {
            cell.addEventListener('mouseover', function() {
                if (window.scrollY === 0) {
                    cell.style.zIndex = '1001'; // Ensure hover state is above header
                }
            });
            cell.addEventListener('mouseout', function() {
                cell.style.zIndex = 'auto';
            });
        });
    });
  3. Update Table Cell CSS:

    • Ensure the table cells have a default z-index that allows them to be below the header when not hovered.
    .table-cell {
        position: relative;
        z-index: auto;
    }

References

@Bonapara Bonapara changed the title Fix Cropped Cells Under Sticky Table Header on Scroll Cropped Cells Hover Border on Object Table May 29, 2024
@charlesBochet charlesBochet changed the title Cropped Cells Hover Border on Object Table [Timebox] Cropped Cells Hover Border on Object Table Jun 18, 2024
@thomtrp thomtrp linked a pull request Jun 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good for experienced contributor scope: front Issues that are affecting the frontend side only size: hours
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

2 participants