The CSS styling of Vuetify TreeView does not support text wrapping

I'm having trouble getting the long text in this CodePen snippet to break and wrap properly. It extends off screen, rendering the append button unclickable. I've experimented with various CSS rules but haven't found a solution yet.

Check out the CodePen here

<div id="app">
  <v-modal>
    <v-container class="modal-container">
      <v-card>
  <v-treeview :items="items">
                <template slot="prepend" slot-scope="{ item, open, leaf }">

                </template>
                <template slot="append" slot-scope="{ item, open, leaf }"><v-btn small>Do Action</v-btn></template>
              </v-treeview>
        </v-card>
    </v-container>
  </v-modal>
</div>


new Vue({
  el: '#app',
  data() {
    return {
      item: null,
      items: [
        {
          id: 0,
          children: [{
            id:1,
            name: "Child Text",
          }],
          name: "Long Text - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
        },
        {
          name: "Short text"
        },
      ]
    }
  }
})

Answer №2

<style>
.v-treeview-node__label{
  white-space: normal !important;
}
</style>

When utilizing Vue, simply add the following code to your App.vue file

By default, the white-space property is set to nowrap, which is why text may appear truncated like:

"Very long text abou..."

With the added CSS lines, it will be displayed properly as:

"Very long text about
something important"

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Alignment of Material-UI dialogue buttons on the left side

I have a Dialog containing three buttons as shown below: https://i.stack.imgur.com/T6o35.png Here is the JSX code: <DialogActions classes={{ root: this.props.classes.dialogActionsRoot }} > <Button classes={{ root: this.props ...

Playing only audio and no video in an Android WebView using HTML5

I am currently facing a challenge with a webpage that includes an html5 video and css3 animations. While the web page functions perfectly on an android device's browser, I am experiencing laggy, glitchy, and jumpy animations when using hardware accele ...

Detecting Android devices

Issue: My website functions properly on desktop but has a problem with the carousel images skewing on iPhones. To address this, I created a separate CSS styling for iPhone devices and used a JavaScript function found online to detect iPhones and iPads. Un ...

Grid items displaying incorrectly due to text alignment issues

I'm facing an issue where I need to separate text and the money part, and also align the text in a way that when viewed in smaller text sizes, the money part moves to the next line. .outdoor-card { display:flex; flex-wrap: wrap; width: 100%; ...

Having trouble eliminating the underline on Vue router-link?

I've experimented with various approaches in an attempt to remove the underline from router-link. This is the code I have: <router-link :to="{name: 'Plan'}"> <div>Plan Your Trip</div> <div class=&apos ...

Identifying the position of an element as the first, nth, or last child within its parent using ReactJS

I'm currently experimenting with dynamic functionality in ReactJS and I need to determine the position of a child relative to its parent. How can I achieve this in ReactJS? I have come across this post which discusses detecting relationships between ...

Tips on wrapping div elements while maintaining equal width in different screen sizes using @media queries

Does anyone have a solution for wrapping divs using @media screen while maintaining equal width on all divs? I've tried using float and inline-block, but can't seem to achieve consistent justified widths. While table-cells maintain equal field wi ...

I require fixed headers that no longer stick once reaching a specific point

I have a setup where the names and occupations of participants are displayed next to their artworks, and I've made it sticky so that as we scroll through the images, the names stay on the left. Now, I want the names to scroll out once the images for e ...

Troubleshooting: Vuetify's 'mt-32' Margin Utility Class Not Producing Desired Results

I'm currently delving into the world of vuetify and struggling with adding the mt-32 class to the v-form in my code snippet below. <template> <v-form class="mt-32"> <v-container> <v-row align="center&quo ...

What is the best way to add a key to a JavaScript array while keeping it reactive in Vue.js?

If there's an array in the state: state: { users: [] }, Containing objects like: { id: 1, name: "some cool name" } To add them to the store using a mutator like users.push(user);, how can we ensure that instead of 0:{...}, it uses the ...

The flash movie covers part of the menu that is relatively positioned

While designing a website, I encountered an issue with the Flash slider (CU3ER) overlapping the menu bar. Despite trying various z-index configurations to ensure the drop-down menu stays on top, none of them seem to work. Initially, the drop-down menu rem ...

Using Vuejs to customize the color of disabled drop-down text

I'm trying to achieve the functionality where selecting an item from a dropdown list disables that option. Currently, my code works as expected, but I find the color of the disabled text too light. Is there a way to adjust the color of the disabled te ...

I can't figure out Laravel Passport

Despite reading numerous articles and watching videos on Laravel Passport, I am still struggling to grasp certain concepts. My application works with Laravel 5.5 + vueJs, where all backend requests are made via axios and the routes are located in api.php ...

Having trouble with imagecopyresampled function, unsure of the reason behind its malfunction

I am currently trying to use imagecopyresampled to crop a specific section of an image, in order to prevent users from uploading photos larger than the intended size on my website. However, I am facing an issue where imagecopyresampled seems to be resizing ...

Difficulty with Flexbox in Internet Explorer 11 when utilizing a Bootstrap .badge element

At the moment, I am dealing with a flex-row that contains an element that grows with the available space and a badge that should be aligned to the end without growing. However, when using flex-grow: 0 in IE11, the span.badge does not even take up the width ...

To prevent the animation from overflowing, set the parent element to have hidden overflow while still displaying the child element

I am facing an issue with two menus that can be toggled using a switch. Each menu item has a dropdown that appears when clicked. The problem arises when switching between the menus, as there is an animation for the transition (slide in and slide out). I wa ...

Tips for dividing the WordPress header navigation horizontally using separate PHP files

I am trying to customize my WordPress menu navigation by splitting it into two sections: left and right. I have added the menu function in the "functions.php" file to create the menu from the backend, and the frontend modifications will be done in the "hea ...

Incorporating various vertical divs with 100% height and width

Struggling to achieve the creation of multiple divs with 100% width and height? Here is an example: <html> <body> <div id="wrapper"> <div id="1">100% height & width, all you can see when opening this file!</div&g ...

Applying styled numbering to elements using nth-child selector in

I have a div with multiple p tags inside. My goal is to assign them numbers using CSS. The number of p tags may vary. By using the :nth-child() selector and the ::before pseudo-element, I can achieve something like this: div p:first-child::before { ...

Eliminate billing information from the Woocommerce order management page on the backend

Is there a way to modify the text "Paid on" in the backend order details page of WooCommerce? I have already implemented this for BACS and local pickup payment methods. Replace a specific word for BACS payment method in Woocommerce order edit pages I am ...