How to customize the footer in Vuetify's list, menu, and combobox components

I've been struggling to add a footer to the Vuetify components like lists, menus, and comboboxes. Despite trying numerous CSS solutions, I haven't found one that works.

What I'm aiming for is to have a fixed bottom button visible at all times, even when scrolling:

https://i.sstatic.net/QtcEv.png

Traditional fixed CSS techniques haven't proven effective, regardless of the element I apply them to.

Here's an example of the combobox where I'm attempting to implement the footer:

<v-combobox
    style="min-width: 260px;"
    dense
    :value="item.description"
    :items="products"
    item-text="name"
    item-value="id"
    :error-messages="item.description_error"
    :filter="filter_products"
    @input="product_selected"
    ref="description">
    <template
        slot="item"
        slot-scope="{ index, item, parent }">
        <v-list-tile-content v-if="!item.footer">{{ item.name }}</v-list-tile-content>
        <v-btn v-else flat dark small style="padding-left:0!important;margin-left:0!important;display:table-row;width:100%"
           color="primary"
           depressed
           :ripple="false"
           @click.stop="add_new_product"><v-icon left>add_box</v-icon>{{ item.footer }}</v-btn>
    </template>
</v-combobox>

I've also experimented with using v-menu and v-list:

<v-menu max-height="250px">
    <v-text-field label="Hello" slot="activator"></v-text-field>
    <v-list>
        <v-list-tile v-for="item in 10">hello</v-list-tile>
    </v-list>
    <p style="position: fixed; bottom: 0;">IUWHEGIuiHWEGIUHGIWUEHGIUWHEGIUHWEIUG</p>
</v-menu>

Answer №1

Check out this Codepen example

To enable scrolling within the list and not the entire menu, remember to include max-height and overflow: auto styles for the v-list element.
Don't forget to add a "footer" at the bottom of the v-menu, it should function as expected.
For a non-transparent menu, enclose it within a v-card.

<v-menu v-model="menu" offset-y>
  <v-btn slot="activator">Menu</v-btn>
  <v-card>
    <v-list class="custom-list">
      <v-list-tile v-for="item in items"></v-list-tile>
    </v-list>
    <v-divider></v-divider>
    <div class="pa-1" @click.stop="">
      <v-btn flat dark small color="primary" depressed :ripple="false">
        <v-icon left>add_box</v-icon>
          footer button
      </v-btn>
    </div>
  </v-card>
</v-menu>

CSS

.custom-list {
  max-height:200px; 
  overflow: auto;
} 

Utilize @click.stop="" to prevent the menu from closing unexpectedly.

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

What is the best way to swap out an element in vue.js 2?

Here is an example of my Vue component structure: <template> <div> <ul class="list-inline list-photo"> <template v-for="item in items"> <li> <a href="javascript:; ...

Looking for assistance in creating a stunning portfolio showcase?

As I work on building my portfolio webpage, I've realized that with my limited knowledge of HTML/CSS, creating a great gallery might be challenging. In search of an efficient solution, I ventured across the web but couldn't find anything that ful ...

How to layer a div on top of another using CSS

I have a container div that is styled with CSS properties. When a button is clicked, I need to display a modal overlay with a message. <div class="dvLanding"> <div class="popupArea"> <span class="VoteOnce">You can only vote ...

The button will continue to be enabled even if the textfield is empty

I have a task to implement a feature on a webpage where the submit button should remain disabled until all values are entered in the textbox. However, I am facing an issue where the submit button is already active when the page loads. .directive('pas ...

Analyzing an HTML document

My current challenge involves extracting the username from an HTML Page based on who is accessing it. The username is displayed on the page, but its location may vary depending on the user. I'm curious to hear how others would approach this issue. My ...

What is the reason behind shadow dom concealing HTML elements when viewed in inspect mode?

https://i.stack.imgur.com/UZM7f.png Monday.com has implemented Shadow Dom to protect its source code. How can I work around this limitation? ...

I am finding that the text I am creating using context.fillText keeps getting distorted within the canvas

I am attempting to place text inside a canvas element. The HTML markup for the canvas is as follows: <canvas id="leaderboard2" style="position: fixed; right: 1250px; top: 140px; width: 230px; height: 330px;"></canvas>. Des ...

Looking to display a submenu next to its parent element

I have a list that is not in order: <ul> <li>Parent-1 <ul> <li>Child-1</li> <li>Child-2</li> <li>Child-3</li> </ul> </li> <li>Parent-2 <ul> <li>Ch ...

Is there a way to simulate a minified module for testing purposes?

For my project, I developed a component intended to function as a module. The implementation involves the utilization of third-party code provided in the form of a config file (initOpinionLab.js) and a .min.js file (opinionlab.min.js). As part of the devel ...

How to activate a media query in response to user interaction using JavaScript

My responsive web page has various designs for different screen sizes, implemented using @media queries. I am interested in allowing users to manually adjust the design for smaller or larger screens without actually changing the screen size. Is there a wa ...

I need to find a way to dynamically filter a Json object, taking into account that my filter condition may vary. The number of possible scenarios

I need to dynamically filter my data based on changing conditions. For example, I want to call a method on the <select (change)="filterData($event.target.value,'jobStatusId')" >, but the condition to filter by can be dynamic, such ...

Applying font size constraints in TailwindCSS

Is it possible to implement the clamp() CSS function with TailwindCSS in order to create linear scaling for the fontSize within a defined range? I am specifically curious about how this can be integrated with Next.js. ...

Having trouble with jQuery's scrollLeft function on elements that are not currently visible

Within a large container DIV that contains numerous other elements and has a scroll bar, an issue arises when determining the value of scrollLeft. When the DIV is visible, the scrollLeft() function returns the correct value, but when the element is hidden, ...

Is it possible to direct the user to a particular link upon swiping to unlock?

Hello everyone, I could use some assistance with this code. I am looking to redirect someone to a specific page when they swipe to unlock and automatically transfer them to another page when the swipe ends. Any help is greatly appreciated. Thank you! $ ...

Center the search box in responsive mode

I am utilizing a bootstrap navigation bar as shown in this source. My aim is to ensure that on mobile devices, users do not have to click on the menu icon to search on the page. I want to display the search box immediately after the Brand in responsive mod ...

The mouseover animation doesn't reset to its original position during quick movements, but instead continues to move without interruption

Greetings! Welcome to my live page. Currently, I am facing an issue with the sliding animation on the header. Specifically, the small gray slide-up divs at the bottom of the sliding pictures are not behaving as expected. They are meant to slide up on mous ...

One interesting characteristic of Javascript localStorage is that it overrides existing data instead of adding to it

I've been experimenting with localStorage to create new divs dynamically. Everything is going well, but I encountered an issue after reloading the page and clicking the bag button again. The previously created divs are being replaced by the new ones i ...

I am encountering an error message that states "Uncaught TypeError: Cannot read property 'use' of undefined."

https://i.sstatic.net/HcwYr.png Error: Unable to access the 'use' property of an undefined object ...

What is the best way to shift a link to the right within a "div" element?

I've been working on setting up a navigation menu for my website, and I'm having trouble getting the "quit" link to align to the right while keeping the other links aligned to the left. I've tried various methods but just can't seem to ...

What's the best way to animate the navigation on top of an image for movement?

I am currently in the process of creating my website as a graphic designer. My unique touch is having the navigation positioned on top of an image (which is animated via flash). This setup is featured prominently on my homepage, which is designed with mini ...