Skip to content

Conversation

@chiubaka
Copy link

Fixes a bug where EditableText controlled value cannot be reset to undefined or null.

The comments in this file state that the point of mirroring the props.value to state.value is to maintain that value while the user
is editing. However, if the user is not editing, the edited line in question as is does not allow for the value of the component to be
reset to something undefined or null for emptiness.

Fixes #0000

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Reviewers should focus on:

Screenshot

Fixes a bug where EditableText controlled value cannot be reset to undefined or null.

The comments in this file state that the point of mirroring the `props.value` to `state.value` is to maintain that value while the user
is editing. However, if the user is not editing, the edited line in question as is does not allow for the value of the component to be
reset to something undefined or null for emptiness.
@palantirtech
Copy link
Member

Thanks for your interest in palantir/blueprint, @chiubaka! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@adidahiya
Copy link
Contributor

You're failing a unit test:

image

I think you'll need to abstract the logic for getting the value from this.props into a small private helper method, as it is used in the constructor as well.

In addition, can you please add a unit test for this behavior change?

@adidahiya
Copy link
Contributor

superseded by #3924

@adidahiya adidahiya closed this Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants