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

Make detect empty string before assign image description #5994

Merged
merged 3 commits into from
Dec 12, 2017

Conversation

neet
Copy link

@neet neet commented Dec 12, 2017

When I tried to delete image description text, a bug occurred.

see following vid:
default

this case, even if I'm pressing delete key, the text will re-appear when trying to delete the last character. and this PR fixes it, here's the bug reason:

  1. When description changed, component calls handleInputChange() and it sets e.target.value to this.state.dirtyDescription
  2. description will be this.state.dirtyDescription or media.get('description') or an empty string
  3. When trying to delete last char, this.state.dirtyDescription will be null, so description becomes media.get('description')
  4. But media.get('description') still holds description that before I try to delete it.

So it needs to detect whether this.state.dirtyDescription is null or just an empty string.

@Gargron Gargron merged commit 0c8b1eb into mastodon:master Dec 12, 2017
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

Successfully merging this pull request may close these issues.

2 participants