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

"[object Object]" appearing in tooltip when hovering column header #1176

Closed
Baloche opened this issue Jul 20, 2018 · 2 comments
Closed

"[object Object]" appearing in tooltip when hovering column header #1176

Baloche opened this issue Jul 20, 2018 · 2 comments

Comments

@Baloche
Copy link

Baloche commented Jul 20, 2018

Hello, I think I'm facing an issue : when I put a React element in the label prop of a column, the tooltip "[object Object]" appears when I the cursor is hovering the column header :

<Table /* ... props */>
    <Column
      label={<LocalizedText id="WEB_LAST_MEASUREMENT" />}
      /* ... other props */
    />
</Table>

After inspecting the node, I can see that the span element in the header has its prop title containing the react element I declared as the label :

{
  children: {},
  className: "ReactVirtualized__Table__headerTruncatedText",
  title: {,
    $$typeof: Symbol(react.element),
    _owner: FiberNode{},
    _store: {},
    key: null,
    props: {},
    ref: null,
    type: LocalizedText()
  }
}

I think I can fix that by giving the Column a custom headerRenderer prop, but I don't think that's the expected behaviour. Or am I doing something wrong ?

@wuweiweiwu wuweiweiwu added the bug label Jul 21, 2018
@ingvardm
Copy link

ingvardm commented Dec 19, 2018

[EDIT]
are you doing something like:
const page = {
title: 'some title'
}
...
<Page {...page}/>
...

Cos if you do: you are passing title attribute which is responsible for the tooltip content

@BykovDenis
Copy link

BykovDenis commented Jun 10, 2021

You can try like this

ReactDOMServer.renderToString(<LocalizedText id="WEB_LAST_MEASUREMENT" />)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants