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

Avoid re-render (so editable input blur) when parent container renders #62

Open
ibc opened this issue Aug 24, 2017 · 1 comment
Open

Comments

@ibc
Copy link

ibc commented Aug 24, 2017

Currently, as far as the parent component is rendered, the RIEInput component is also rendered so, even if the user was editing the input, the RIEInput assumes that the parent has provided him with a new value and hides the <input> (producing mouse blur and so on).

So finally, I had to write a simple wrapper component which just holds a RIEInput component, and implements shouldComponentUpdate(nextProps, nextState) returning false if the newProps.value === this.props.value.

Of course, this makes imposible for the parent component to change other RIEInput props such as `className, and so on, but it becomes much more easier to use.

So, shouldn't RIEInput internally implement something like this?

@timminkov
Copy link

I'm here three years later looking for a solution for this, and now considering writing my own editable text area 😆

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

2 participants