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

When I give empty data, an empty row appears #138

Closed
arifsygl opened this issue Nov 30, 2022 · 8 comments
Closed

When I give empty data, an empty row appears #138

arifsygl opened this issue Nov 30, 2022 · 8 comments
Labels
invalid This doesn't seem right needs more info Needs more information

Comments

@arifsygl
Copy link

Describe the bug
When I give empty data, an empty row appears

Screenshots
Screen Shot 2022-11-30 at 17 58 14

Screen Shot 2022-11-30 at 17 58 54

Desktop (please complete the following information):

  • OS: [e.g. macOs]
  • Browser [chrome]

Thanks for helps.

@icflorescu
Copy link
Owner

I'm sorry, but I am unable to reproduce.

Try setting a minHeight and see if the problem persists.
Have a look at the empty-state docs/examples: https://icflorescu.github.io/mantine-datatable/examples/empty-state

If you still think there's a problem, please provide a working example (on codesandbox or something like that)...

@icflorescu icflorescu added the needs more info Needs more information label Nov 30, 2022
@arifsygl
Copy link
Author

arifsygl commented Nov 30, 2022

I am sharing the codesandbox link below. When you inspect the table, you will see an empty row and an empty column appear.

I noticed that when I use Tailwind, it gives a border to the empty column, so I'm having such a problem.

https://codesandbox.io/s/elated-mayer-rbu7h1

image

@icflorescu
Copy link
Owner

The provided sandbox is not functional:

image

But, since you've mentioned tailwind, I think I understand what the problem might be.
Mantine DataTable needs to display an empty row (specifically styled as to be invisible) when it contains no records.
Tailwind appears to somehow override the styling of that empty row in your case.

TL;DR

See if scoping tailwind helps.

Explanation

As you know, the component is built upon (and intended to be used in conjunction with) Mantine, an excellent UI library that follows healthy CSS scoping/encapsulation principles.

Tailwind, on the other hand, does not, and therefore doesn't play nice with UI component libraries. It's not necessarily bad per se (you could probably use it with their paid UI components), but if you ask me, it gives you the false impression that you don't actually need to know CSS, ir creates more problems than it solves and in the end it promotes bad practices. That is why I'm getting more and more biased against it nowadays. seeing how it's thoughtlessly adopted without considering the implications.

We could, arguably, do more in Mantine DataTable to increase our styling selectors specificity. But, in doing so, we'd end up adding unnecessary bloat to our library in order to accommodate unwanted side-effects generated by tailwind or other things that do not follow CSS scoping/encapsulation best practices.

@icflorescu icflorescu added the invalid This doesn't seem right label Dec 1, 2022
@arifsygl
Copy link
Author

arifsygl commented Dec 1, 2022

@icflorescu Thank you for your fast response!

@aaly00
Copy link

aaly00 commented Dec 2, 2022

facing same problem

@aaly00
Copy link

aaly00 commented Dec 2, 2022

image

I don't use tailwind

@aaly00
Copy link

aaly00 commented Dec 2, 2022

I created a working stackblitz demonstrating the issue
nextjs: https://stackblitz.com/edit/nextjs-b4kcz9?file=pages/index.js
reactjs: https://stackblitz.com/edit/react-ts-pdowhj

@icflorescu icflorescu reopened this Dec 2, 2022
@icflorescu
Copy link
Owner

Thanks for the stackblitz.
Fixed in v1.7.22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right needs more info Needs more information
Projects
None yet
Development

No branches or pull requests

3 participants