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

Don't update the state of the form if WYSIWYG content has not changed #1378

Merged
merged 2 commits into from
Jun 14, 2018
Merged

Don't update the state of the form if WYSIWYG content has not changed #1378

merged 2 commits into from
Jun 14, 2018

Conversation

johanbaath
Copy link
Contributor

My PR is a:

🐛 Bug fix

Main update on the:

Admin

Description

Since the first field is autofocused (key === 0), this causes a problem with WYSIWYG fields emitting an onChange event.

When the edit page loads, the first field is focused even before data has loaded. So when this field is a WYSIWYG, it will change the value to a blank string. Saving the form without touching the first field makes it a blank string effectively wiping it from the database.

@lauriejim lauriejim added pr: 🐛 Bug fix source: core:content-manager Source is core/content-manager package source: core:admin Source is core/admin package and removed source: core:content-manager Source is core/content-manager package labels Jun 13, 2018
Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@soupette
Copy link
Contributor

Thanks @johanbaath I didn't cover this use case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: core:admin Source is core/admin package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants