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

RIEInput is disabled after being edited #47

Open
suziesirena opened this issue Jun 16, 2017 · 4 comments
Open

RIEInput is disabled after being edited #47

suziesirena opened this issue Jun 16, 2017 · 4 comments

Comments

@suziesirena
Copy link

I'm using React and Material UI table.
I want to make the table cells editable so I put a RIEInput in a cell of the table.
The problem is that after being edited, the RIEInput is disabled :

projet sans titre 1

you can see that the 'loading' state remains to 'true' after leaving focus the element.

here is my code :

      <TableRow key={index}>
          <TableRowColumn>
            <RIEInput
              value={item.title}
              change={(text) =>self.updateTitle(text, item.ID)}
              propName="text"
              validate={_.isString}
                />
          </TableRowColumn>
        </TableRow>

how can I manage this strange behavior?

@suziesirena
Copy link
Author

As a workaround, I have changed line 102 of RIEStatefulBase.js to force disabled to false:

disabled: false, //_this.state.loading,

But I would know why the loading state remains true...

@ibc
Copy link

ibc commented Aug 17, 2017

The doc clearly explains that it will be disabled until the parent React components renders the input again.

@saikat-bhattacharya
Copy link

I am also facing the same problem while using with React hooks. Any solution here?

@arel
Copy link

arel commented Sep 9, 2019

It looks like this project isn't active anymore, but inspired by @suziesirena's comment, I came across a workaround that does not require changing the source code. Use the editProps property to prevent disabling:

<RIEInput
  value={item.title}
  change={(text) =>self.updateTitle(text, item.ID)}
  propName="text"
  validate={_.isString}
  editProps={{ disabled: false }}
/>

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

No branches or pull requests

4 participants