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

[data grid] Focus outline has multiple visual bugs #5783

Open
aaarichter opened this issue Aug 13, 2022 · 3 comments
Open

[data grid] Focus outline has multiple visual bugs #5783

aaarichter opened this issue Aug 13, 2022 · 3 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer

Comments

@aaarichter
Copy link

aaarichter commented Aug 13, 2022

Current behavior 😯

on https://mui.com/x/react-data-grid/layout/ when clicking into a cell of the column header, an outline is shown. This outline has multiple visual bugs:

  1. the data-grid has by default a border-radius, which cuts off the outline (see screenshot)
  2. the outline is below the header dividers (see screenshot)
  3. the top outline is missing due to outline-offset: -1px; set to the .MuiDataGrid-columnHeader:focus-within
    Screenshot 2022-08-13 at 19 21 51

Expected behavior 🤔

  1. those visual bugs should be fixed
  2. an API way to turn off the outline. ( I overwrote the styles in my theme but that should be configurable )

Steps to reproduce 🕹

Link to live example: https://mui.com/x/react-data-grid/layout/#flex-layout

Steps:

  1. click on the left header cell

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
System:
    OS: macOS 12.5
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
  Browsers:
    Chrome: 104.0.5112.79
    Edge: Not Found
    Firefox: 101.0.1
    Safari: 15.6
  npmPackages:
    @emotion/react: ^11.9.3 => 11.9.3 
    @emotion/styled:  11.9.3 
    @mui/base:  5.0.0-alpha.91 
    @mui/icons-material: ^5.8.4 => 5.8.4 
    @mui/lab: ^5.0.0-alpha.92 => 5.0.0-alpha.92 
    @mui/material: ^5.9.2 => 5.9.2 
    @mui/private-theming:  5.9.1 
    @mui/styled-engine:  5.8.7 
    @mui/system: ^5.9.2 => 5.9.2 
    @mui/types:  7.1.5 
    @mui/utils:  5.9.1 
    @mui/x-data-grid: ^5.14.0 => 5.15.0 
    @types/react: 17.0.45 => 17.0.45 
    react: 17.0.2 => 17.0.2 
    react-dom: 17.0.2 => 17.0.2 
    styled-components: ^5.3.5 => 5.3.5 
    typescript: ^4.7.4 => 4.7.4 

Order ID 💳 (optional)

No response

@aaarichter aaarichter added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 13, 2022
@m4theushw
Copy link
Member

m4theushw commented Aug 16, 2022

Some items we can only do in v6 because they are visual breaking changes.

the data-grid has by default a border-radius, which cuts off the outline (see screenshot)

Nobody complained about that so far but we can fix it by applying the same border-radius to only the very first and very last column header. This way we create the impression that the column headers react to the grid's radius.

the outline is below the header dividers (see screenshot)

In v6 we want to hide the column separators. See #1623

the top outline is missing due to outline-offset: -1px; set to the .MuiDataGrid-columnHeader:focus-within

Actually it's because .MuiDataGrid-columnHeaders has overflow: hidden. We need overflow: hidden for the virtualization.


Instead of outline you can use box-shadow: inset ... to achieve the "outline" effect. We have outline-offset: -1px to simulate the inset shadow.

@m4theushw m4theushw added component: data grid This is the name of the generic UI component, not the React module! design: ui and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 16, 2022
@m4theushw m4theushw changed the title [ColumnHeader] focus outline has multiple visual bugs [data grid] focus outline has multiple visual bugs Aug 16, 2022
@m4theushw m4theushw changed the title [data grid] focus outline has multiple visual bugs [data grid] Focus outline has multiple visual bugs Aug 16, 2022
@aaarichter
Copy link
Author

Some items we can only do in v6 because they are visual breaking changes.

the data-grid has by default a border-radius, which cuts off the outline (see screenshot)

Nobody complained about that so far but we can fix it by applying the same border-radius to only the very first and very last column header. This way we create the impression that the column headers react to the grid's radius.

that would be great @m4theushw

@oliviertassinari oliviertassinari added design This is about UI or UX design, please involve a designer and removed design: ui labels Aug 18, 2023
@LumaKernel
Copy link

Little upvote with Pro plan (order id = 67619) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer
Projects
None yet
Development

No branches or pull requests

4 participants