edisonywh / backoffice

Admin tool built with the PETAL stack
MIT License
217 stars 15 forks source link

Textarea rendering #43

Closed NduatiK closed 3 years ago

NduatiK commented 3 years ago

Hi, I've been using backoffice to edit text in a blog-like application. In most cases, we expect multiple sentences and perhaps multiple paragraphs.

To make editing easy, I have been using the :textarea type on my form field. This however produces json encoded strings.

image

Not pretty or easy to use.

This seems to be caused by the Phoenix.json_library().encode applied to the text here

Removing the json encoding seems to resolve the issue

image

NduatiK commented 3 years ago

Could the encoding be removed? Does it serve a specific purpose?

edisonywh commented 3 years ago

Ah great catch, I was testing out the :textarea form input with editing :map, you can see here the implementation just delegates to :textarea.

I think we should separate them so encoding is only called for :map type and not :textarea

NduatiK commented 3 years ago

Makes sense