prisma / studio

🎙️ The easiest way to explore and manipulate your data in all of your Prisma projects.
https://www.prisma.io/studio
1.9k stars 47 forks source link

Support newlines in field editor #907

Open Powersource opened 2 years ago

Powersource commented 2 years ago

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):

Luchanso commented 2 years ago

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

ElliottJPerry commented 6 months ago

Bump.

OrRon commented 3 months ago

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

ethanSE commented 1 month ago

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