studio icon indicating copy to clipboard operation
studio copied to clipboard

Support newlines in field editor

Open Powersource opened this issue 2 years ago • 3 comments

Describe the bug When doubleclicking on a field to edit it that I know contains newlines, the newlines aren't visible, and if I save then the newlines that used to be there disappear.

To Reproduce Steps to reproduce the behavior:

  1. Using prisma client, create a text field and put a multiline text into it (i.e. a piece of text containing a newline)
  2. View that field in prisma studio
  3. Doubleclick the field to edit, add something like a single letter somewhere. Press enter to exit editing.
  4. Press the "Save 1 change" field that appears
  5. Go back in your app/prisma client, the newlines are gone from the field.

Expected behavior That only the new letter would be added and that newlines would be preserved. A way of adding new newlines in the prisma studio editor would also be nice.

Desktop (please complete the following information):

  • OS: Linux lap 5.17.1-arch1-1 #1 SMP PREEMPT Mon, 28 Mar 2022 20:55:33 +0000 x86_64 GNU/Linux
  • prisma-studio-appimage AUR package.
  • Version: 0.458.0-1

Powersource avatar Apr 08 '22 16:04 Powersource

The same problem, where I can fix studio code and create PR? 🙂

Luchanso avatar Oct 31 '22 17:10 Luchanso

Bump.

ElliottJPerry avatar May 01 '24 07:05 ElliottJPerry

+1 for this. Any suggestion on bypassing this issue without connecting directly to the DB?

OrRon avatar Jul 31 '24 11:07 OrRon

It looks like Prisma Studio is using React Grid (from what I can tell, haven't seen the source code).

I haven't seen the code obviously so this might not be a trivial change but changing this to the Large Text Cell Editor would allow users to enter multi-line text.

https://www.ag-grid.com/react-data-grid/provided-cell-editors-large-text/

Is something like this possible? or could be enabled as a feature or something? The ability to edit multi-line text seems pretty essential for Prisma Studio to be useful

ethanSE avatar Sep 27 '24 20:09 ethanSE