giorgosart / react-easy-edit

Inline editing library for React
https://giorgosart.gitbook.io/react-easy-edit/
MIT License
251 stars 45 forks source link

Empty string hides the placeholder #139

Closed kevko2020 closed 1 year ago

kevko2020 commented 2 years ago

Describe the bug If you enter a value then delete it. The placeholder is gone and there's no way to edit it.

To Reproduce Steps to reproduce the behavior:

  1. In a text/ text area, enter some value save.
  2. Edit it and remove all characters then save.
  3. The whole component is empty.

Expected behavior The placeholder should show again so it's clickable to edit.

Desktop (please complete the following information):

giorgosart commented 2 years ago

Hi @kevko2020, can you please create a codepen for this issue?

kevko2020 commented 2 years ago

What's a codepen?

giorgosart commented 2 years ago

CodePen is an online community for testing and showcasing user-created HTML, CSS and JavaScript code snippets. https://codepen.io/accounts/signup/user/free.

darrenplace commented 2 years ago

Hello @giorgosart,

I'm experiencing the same issue and have recreated the issue in this codesandbox.

With the version used in the documentation (1.7.0) things work as expected. When all text is removed and the changes are submitted, the placeholder text appears.

However, in the latest version (1.15.0) the component seems to disappear once a blank textbox is submitted.

Thanks for creating this awesome module!

ghost commented 2 years ago

Looks like it works in 1.14.0

giorgosart commented 1 year ago

@kevko2020, @darrenplace this will be fixed in the next release in queue.