When using a React.Element as title for columns, The editable placeholder renders as "Object"
When using a complex title instead of a simple string this happens:
Title is defined as:
title?: string | React.ReactElement
Exemplary code
columns={[
{ title: <div>Italiano (chiave)<img style={flagstyle} src='whatever.png'></img></div>, field: 'it' }

Warning: Failed prop type: Invalid prop placeholder of type object supplied to ForwardRef(InputBase), expected string.
in ForwardRef(InputBase) (created by WithStyles(ForwardRef(InputBase)))
in WithStyles(ForwardRef(InputBase)) (created by ForwardRef(Input))
in ForwardRef(Input) (created by WithStyles(ForwardRef(Input)))
I don't think the issue is on the title, I think it has to do with the data. My guess is that maybe instead of passing a string value, you're passing an object. What else do you have in columns?
The issue is on the title, as i have tested to just type "whatever" then it renders correctly. Basically the title is used as a placeholder internally causing the error. However a ReactElement is allowed to be used as a title e.g. if you want to render something else other than a plain string. Maybe something called "editPlaceholder" would be a nicer way to solve the problem. Then you can specify something like "Type new value..."
This problem is not resolved? ReactElement in title is possible, but not in the crap placeholder. But for the placeholder, the value is taken from the title
Then the proper way to solve this would be to allow a ReactElement for title and a String for "titlePlaceholder" ;) The way it is now, is not correct and definitely buggy or at least error-prone
Suggestion for fixing this issue properly. I'm sorry for not providing a pull request but i don't have the proficiency to know if this is enough or not. But it should be a reasonable solution which should not break current implementation by providing additional functionality
In m-table-edit-field.js
Instead of :
placeholder={this.props.columnDef.title}
use:
placeholder={(typeof this.props.columnDef.title !== 'string') ? this.props.columnDef.placeholder : this.props.columnDef.title}
Then in the column definition the following would be possible:
{ title: <div>Key<MdiIcons.Key style={{marginLeft: 5, verticalAlign: "bottom", color: "gray"}}></MdiIcons.Key></div>, field: keyIso, placeholder: "Key" },
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.