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

titleField column header is not aligned in Dataviews #68838

Open
2 of 6 tasks
ecgan opened this issue Jan 22, 2025 · 0 comments · May be fixed by #68840
Open
2 of 6 tasks

titleField column header is not aligned in Dataviews #68838

ecgan opened this issue Jan 22, 2025 · 0 comments · May be fixed by #68840
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@ecgan
Copy link
Contributor

ecgan commented Jan 22, 2025

Description

When we have a titleField in Dataviews, the column header is not aligned properly.

This issue can be seen in storybook - see https://wordpress.github.io/gutenberg/?path=/docs/dataviews-dataviews--docs:

Image

In the case above, we have titleField: 'title', and we can see that the "Title" column header is shifted to the left by a few pixels, and it is not aligned with the search box above it and the rows below it.

The cause of the problem seems to be this <span class="dataviews-view-table-header"> with margin-left: -8px;:

Image

In comparison, if we look at Dataviews with no titleField, the first column header would align nicely:

Image

In this "Title" column, there is no <span class="dataviews-view-table-header">:

Image

Step-by-step reproduction instructions

  1. Use a Dataviews, without a titleField. You should see that the first column header is aligned perfectly.
  2. Set a titleField. You should see that the first column header is NOT aligned perfectly.

Screenshots, screen recording, code snippet

No response

Environment info

I noticed this issue when I am using Dataviews in a plugin. I'm using bundled Dataviews by doing import { DataViews } from '@wordpress/dataviews/wp'.

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@ecgan ecgan added the [Type] Bug An existing feature does not function as intended label Jan 22, 2025
@Mamaduka Mamaduka added the [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond label Jan 22, 2025
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants