Text field wrapping in index #6073
-
Description:Hello, I tried out the following on a large text field: This is the field definition: Text::make(__('Name'), 'name')
->sortable()
->rules('required', 'max:255')
->displayUsing(function ($name) {
return __($name);
})
->withMeta(['wrapping' => true]), Detailed steps to reproduce the issue on a fresh Nova installation:The reason why it isn't working is the class in the span for the field. Maybe it should be like the In js/fields/Index/TextField.vue: <span
v-else-if="fieldValue && !field.copyable && !shouldDisplayAsHtml"
class="whitespace-nowrap"
>
{{ fieldValue }}
</span> I saw the same
It shouldn't change anything because the default value for wrapping is "false". If more information is needed, I will try to provide it asap. Thanks for the great tool! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
It's not recommended to put large amounts of text in table views. The table cells are designed to avoid wrapping by default to allow for responsive scrolling, which is preferable (in our opinion) to larger height table rows. |
Beta Was this translation helpful? Give feedback.
-
@schonhoff Here is the solution I implemented. I simply fixed this with CSS. I had already added my own CSS file, implemented Tailwind and a build process. Here is the CSS code I used:
If you need this in vanilla CSS, it would look like this:
Now the HTML markup in Nova is hard to work with. Very few classes exist when you get deeper into elements, so sometimes you have to do a lot of digging through div after div to target specific elements. However, this one was pretty easy to get at. |
Beta Was this translation helpful? Give feedback.
@schonhoff Here is the solution I implemented. I simply fixed this with CSS. I had already added my own CSS file, implemented Tailwind and a build process. Here is the CSS code I used:
If you need this in vanilla CSS, it would look like this:
Now the HTML markup in Nova is hard to work with. Very few classes exist when you get deeper into elements, so sometimes you have to do a lot of digging through div after…