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

Adding an image to an empty rich text editor doesn't trigger the Image widget #895

Closed
imorente opened this issue Dec 8, 2017 · 7 comments

Comments

@imorente
Copy link
Contributor

imorente commented Dec 8, 2017

- Do you want to request a feature or report a bug?
Bug

- What is the current behavior?

add-image-bug

- If the current behavior is a bug, please provide the steps to reproduce.

  • Create a new post that has a rich text field
  • Click on the editor, then click on the + button and select "Image" from the dropdown
  • The image widget appears for a second and disappears, leaving the text ![null]()

- What is the expected behavior?

  • The image widget doesn't disappear.

- Please mention your CMS, node.js, and operating system version.

Netlify CMS version 1.0.0, Chrome Version 62.0.3202.94 (Official Build) (64-bit), Mac OS Sierra

@tech4him1
Copy link
Contributor

I can reproduce, but this only seems to happen with new entries -- if all the content is removed from an existing entry the image widget still works for me.

@tech4him1
Copy link
Contributor

tech4him1 commented Dec 8, 2017

#829 partially affects this, but it doesn't seem to be the main cause -- If an image widget is added, it still seems to "crash", just not quite as hard.

@tech4him1
Copy link
Contributor

Looking at Redux, on initial load entryDraft.entry.data.body is set to null instead of an empty string. Only when it is null does the image widget crash.

@erquhart
Copy link
Contributor

@tech4him1 moved that bit from your last comment into a separate issue, #956.

@tech4him1
Copy link
Contributor

@erquhart No, my comment is not talking about the alt text being null. My point was that entryDraft.entry.data.body should be set to an empty string initially, so that the image widget didn't crash.

@tech4him1
Copy link
Contributor

@erquhart I believe the null crashing part was fixed in #955.

@erquhart
Copy link
Contributor

erquhart commented Jan 2, 2018

Ah, I see what you mean. Yeah that's a general problem, not sure why things are being set to null. I would assume it's somewhere in our Redux implementation.

Opened #977 to address.

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

No branches or pull requests

3 participants