uasoft-indonesia / badaso

Laravel Vue headless CMS / admin panel / dashboard / builder / API CRUD generator, anything !
https://badaso.uatech.co.id
MIT License
1.21k stars 223 forks source link

Breakline in Textarea #562

Closed Dri372 closed 2 years ago

Dri372 commented 2 years ago

Is your feature request related to a problem? Please describe. see #550

Describe the solution you'd like Render linebreak as input in a Textarea Crud.

Idea of solution • add the following code in vendor/badaso/core/src/resources/js/pages/crud-generated/browse.vue

....                    
  <span
                        v-else-if="dataRow.type == 'textarea'"
                        v-html="nl2br(record[$caseConvert.stringSnakeToCamel(dataRow.field)])"
                      ></span>
....    
    ◦ methods :
    nl2br(v) {
      return `${v}`.replace(/\n/g, "<br />");
    },
rizkiheryandi commented 2 years ago

I think textarea is not right fileld for breakline, let textarea just as it should be

you can use wysiwyg / editor for that

i already read your issue about can't use multiple editor in a form, i think we can fix that instead of change textarea behavior

you can also create a PR if possible :)

thank you

Dri372 commented 2 years ago

Hi rizkiheryandi

When you edit a 'Textarea' , linebreaks are rendered (that's what I/we expect), but in the browse view linebreaks are not rendered. So 'let textarea just as it should be' means, for me, render the linebreaks in the browse view :-)

Editor is a is too complete/complex tool for such a small layout.