Material-table: Editable Currency type render "ok"

Created on 2 May 2019  路  4Comments  路  Source: mbrn/material-table

Describe the bug
I'm using Editable field data and set type as currency and then in inline editing ok is show up!.

To Reproduce
Steps to reproduce the behavior:

  1. Set Columns and field type as currency.
  2. Define editable onRowUpdate callback.
  3. Run & click edit icon.
  4. "ok" will show up.

Expected behavior
Inline Textbox for currency format.

Screenshots
image

Desktop (please complete the following information):

  • OS: Any
  • Browser Any
bug

Most helpful comment

As a workaround for now, you can overwrite the editComponent in the column definition:

{
      title: "Value",
      field: "value",
      type: "currency",
      editComponent: props => (
        <input
          type="numeric"
          value={props.value}
          onChange={e => props.onChange(e.target.value)}
        />
      )
}

All 4 comments

As a workaround for now, you can overwrite the editComponent in the column definition:

{
      title: "Value",
      field: "value",
      type: "currency",
      editComponent: props => (
        <input
          type="numeric"
          value={props.value}
          onChange={e => props.onChange(e.target.value)}
        />
      )
}

Its because there is no currency field definition at the moment: https://github.com/mbrn/material-table/blob/v1.50.0/src/components/m-table-edit-field.js#L126

As a workaround for now, you can overwrite the editComponent in the column definition:

{
      title: "Value",
      field: "value",
      type: "currency",
      editComponent: props => (
        <input
          type="numeric"
          value={props.value}
          onChange={e => props.onChange(e.target.value)}
        />
      )
}

@bobctr Thanks for the workaround, do you have any idea how can I make it similar to the other fields?

image

Cannot be reproduced anymore. IF this is still relevant, feel free to reopen this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

behrouz-s picture behrouz-s  路  3Comments

balibou picture balibou  路  3Comments

Likurg2010 picture Likurg2010  路  3Comments

lazeebee picture lazeebee  路  3Comments

diegosps picture diegosps  路  3Comments