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

The class name of Table title have unexpected ForwardRef prefix. #437

Closed
salmanorak opened this issue Dec 20, 2021 · 8 comments
Closed

The class name of Table title have unexpected ForwardRef prefix. #437

salmanorak opened this issue Dec 20, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@salmanorak
Copy link

salmanorak commented Dec 20, 2021

Describe the bug

The wrappers of title, actions and etc. on the toolbar are having unexpected class names prefix as ForwardRef(MTableToolbarRef).

To Reproduce

  1. Kindly open the sandbox below.
  2. Inspect the table title
  3. Check the table title field HTML on the developer tools.
  4. See "ForwardRef(MTableToolbarRef)-title-9" class.

Sandbox

Expected behavior

Instead of "ForwardRef(MTableToolbarRef)" it should have "MTableToolbar" prefix on each part's class name

Screenshots
image

Desktop :

  • OS: [Window 10]
  • Browser [chrome]
  • Version [96.0.4]

Version:
@material-table/core : 4.3.11
@material-ui/core : 4.12.3

@salmanorak salmanorak added the bug Something isn't working label Dec 20, 2021
@salmanorak salmanorak changed the title The class names of Table title have unexpected ForwardRef prefix. The class name of Table title have unexpected ForwardRef prefix. Dec 20, 2021
@saiemsaeed
Copy link

Thank you for starting this issue @salmanorak, I'm also facing this issue.

@oze4
Copy link
Member

oze4 commented Dec 21, 2021

Since these components are using ForwardRef, is this expected behavior? Or should that not show up in the rendered class name when using ForwardRef?

I'm asking because I do not know if this is expected or not when using ForwardRef.

@oze4 oze4 self-assigned this Dec 21, 2021
@ymor
Copy link
Contributor

ymor commented Dec 21, 2021

@oze4 This is not expected behaviour, you shouldn't see the ForwardRef in the class name, though technically it doesn't actually cause any issues as the class has the correct styles.
I had a quick look and changing

export default withStyles(styles)(MTableToolbarRef);

to

export default withStyles(styles, { name: 'MTableToolbar' })(MTableToolbarRef);

Results in the classes having the MTableToolbar prefix:
image

@oze4
Copy link
Member

oze4 commented Dec 21, 2021

@ymor thank you so much for figuring this out! I will make the necessary changes and publish a new version.

oze4 added a commit that referenced this issue Dec 21, 2021
@oze4 oze4 mentioned this issue Dec 21, 2021
@oze4 oze4 closed this as completed in a9e65aa Dec 21, 2021
@oze4
Copy link
Member

oze4 commented Dec 21, 2021

Published v4.3.14

@salmanorak
Copy link
Author

thanks a lot @oze4 for your quick handling.
Take care and stay healty.

@salmanorak
Copy link
Author

salmanorak commented Dec 21, 2021

@oze4
I have realized that The same issue is also existing in another field. We have the same issue on MTableHeader.

  • ForwardRef(MTableHeaderRef)

I have checked all markup but couldn't find any other instance except the ForwardRef(MTableHeaderRef). But please do check the code base for possible other instances.

Should I open another bug entry for this one? @oze4

@oze4
Copy link
Member

oze4 commented Dec 21, 2021

#441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants