Align the sidebar item to the bottom position

Struggling with Vuetify, I can't seem to figure out how to use flex properly to position a list at the bottom of a side navigation drawer. My latest attempt is:

<template>
  <v-app id="inspire">
    <v-navigation-drawer
        v-model="drawer"
        app
        color="grey lighten-3"
        mini-variant
        permanent
        expand-on-hover
        class="d-flex fill-height"
    >
      <v-row class="fill-height">
          <v-col class="align-self-start justify-start">
            <v-avatar></v-avatar>
            <v-divider></v-divider>
            <v-list>
              <v-list-item-group>
                <v-list-item>
                  <v-list-item-icon>
                    <v-icon>mdi-map-search-outline</v-icon>
                  </v-list-item-icon>
                  <v-list-item-content>Search</v-list-item-content>
                </v-list-item>
                <v-list-item>
                  <v-list-item-icon>
                    <v-icon>mdi-compare</v-icon>
                  </v-list-item-icon>
                  <v-list-item-content>Compare</v-list-item-content>
                </v-list-item>
                <v-list-item>
                  <v-list-item-icon>
                    <v-icon>mdi-trophy</v-icon>
                  </v-list-item-icon>
                  <v-list-item-content>Ranked</v-list-item-content>
                </v-list-item>
              </v-list-item-group>
            </v-list>
          </v-col>
          <v-col dense class="align-self-end justify-end">
            <v-list>
              <v-list-item-group>
                <v-list-item>
                  <v-list-item-icon>
                    <v-icon>mdi-account</v-icon>
                  </v-list-item-icon>
                  <v-list-item-content>Account</v-list-item-content>
                </v-list-item>
              </v-list-item-group>
            </v-list>
          </v-col>
        </v-row>
    </v-navigation-drawer>

    <v-main>
      <!--  -->
    </v-main>
  </v-app>
</template>

<script>
export default {
  data () {
    return {
      drawer: true
    }
  }
}
</script>

The issue I'm facing with this setup is that the items shift when opening or closing the drawer. What would be the best way to align the second list to the bottom without any unwanted movements?

Answer №1

Looks like the current implementation is functioning as expected. Is this the desired behavior?

Update: The issue with the bottom list item re-rendering upon closure has been resolved.

An additional item was included in the original v-list with a fixed positioning class to ensure it remains at the bottom without triggering a re-render.

.fixedBottom {
  position: fixed !important;
  bottom: 0 !important;
  width: 100%;
}
<!DOCTYPE html>
<html>
<head>
  <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/@mdi/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="15737a7b6155213b6d">[email protected]</a>/css/materialdesignicons.min.css" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d4a2a1b1a0bdb2ad94e6faac">[email protected]</a>/dist/vuetify.min.css" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
  <div id="app">
    <template>
      <v-app id="inspire">
        <v-navigation-drawer
            v-model="drawer"
            app
            color="grey lighten-3"
            mini-variant
            permanent
            expand-on-hover
            class="d-flex fill-height"
        >
          <v-row class="fill-height">
              <v-col>
                <v-avatar></v-avatar>
                <v-divider></v-divider>
                <v-list>
                  <v-list-item-group>
                    <v-list-item>
                      <v-list-item-icon>
                        <v-icon>mdi-map-search-outline</v-icon>
                      </v-list-item-icon>
                      <v-list-item-content>Search</v-list-item-content>
                    </v-list-item>
                    <v-list-item>
                      <v-list-item-icon>
                        <v-icon>mdi-compare</v-icon>
                      </v-list-item-icon>
                      <v-list-item-content>Compare</v-list-item-content>
                    </v-list-item>
                    <v-list-item>
                      <v-list-item-icon>
                        <v-icon>mdi-trophy</v-icon>
                      </v-list-item-icon>
                      <v-list-item-content>Ranked</v-list-item-content>
                    </v-list-item>
                  </v-list-item-group>
                  <v-list-item-group class="fixedBottom">
                    <v-list-item>
                      <v-list-item-icon>
                        <v-icon>mdi-account</v-icon>
                      </v-list-item-icon>
                      <v-list-item-content>Account</v-list-item-content>
                    </v-list-item>
                  </v-list-item-group>
                </v-list>
              </v-col>
            </v-row>
        </v-navigation-drawer>

        <v-main>
          <!--  -->
        </v-main>
      </v-app>
    </template>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9bedeefedba9b5e3">[email protected]</a>/dist/vue.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="017774647568677841332f79">[email protected]</a>/dist/vuetify.js"></script>
  <script>
    new Vue({
      el: '#app',
      vuetify: new Vuetify(),
      data () {
        return {
          drawer: true
        }
      }
    })
  </script>
</body>
</html>

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 create a dynamic-width text input with ellipsis and label in Angular?

I am looking to incorporate a <input type="text"> element in my Angular application that will automatically display an ellipsis if the user-provided value is too lengthy to fit within the UI, unless being edited. This text input will have a dynamic ...

How can I compare just the keys, not the values, in a JSON object using JavaScript

I am dealing with two sets of nested JSON objects //First JSON object { "version": "1", "user": { "id": 123 } } //Second JSON object { "version": "1", "user": { "i": 123 } } 1) The comparison should focus on keys ...

Recharge Backbone prior to a lockdown

I'm currently utilizing a script within Backbone in a Cordova application (Android) that causes the app to freeze for 5 seconds, and unfortunately I am unable to find an alternative method. Due to this issue, I would like to display a loading message ...

Challenges Encountered When Working with Date Fields in Kendo JS Grid

We are facing an unusual issue with the Kendo UI Grid on our production site. Some users are experiencing date fields showing as null in Google Chrome, while they appear correctly in private browsing mode and other browsers like IE and MSEdge. We have bee ...

Strange behavior observed in the trailing comma in Shopify

I had a vanilla js script that initially appeared as follows: const products = [ { id: 1, title: 't-shirt' }, { id: 2, title: 't-shirt' }, { id: 3, title: 'jeans&a ...

npm's global installations persist

Currently, working with the latest npm version on a Mac, I've come across an unusual issue. When attempting to install a package locally in a specific folder, I find myself having to npm init it first. Strangely, if I just run npm install [package nam ...

Confusion with Callbacks Due to Asynchronous Ajax Requests

Essentially, I have a standard ajax function set up like this: function ajax_request(rest_req, url, success_callback, fail_callback) { var xhttp = new XMLHttpRequest; xhttp.onreadystatechange = function () { if (this.readyState == 4) ...

How to handle a Vue element click event through programming

In my Vue instance, I am looking to have a response triggered by a click on an uploaded thumbnail. Utilizing the Vue package called FineUploader Vue with the template layout as outlined in the documentation (refer to end of question). After uploading an i ...

Trouble with JavaScript event listener/button functionality

Seeking a simple fix here. While I have experience in Java, I am slowly but surely delving into Javascript. Currently, I am working on creating a fun website. The specific task at hand involves utilizing the parse api. My approach (as there seemed to be ...

Opt for the modal class over the id for improved functionality

How can I use this modal multiple times on the same page when it only works once due to the id element? Can someone assist me in making it work multiple times on the same page? I have tried the following code, but when I click the button, nothing happens. ...

Is there a viable substitute for websockets that can be utilized on shared hosting platforms?

Are there any viable alternatives for websockets that can be used with shared hosting? While I'm aware of node.js, socket.io, and Express.js, I'm unable to use them in a shared hosting environment. If there are other options available for creatin ...

When clicking outside of tinyMCE, the textarea will be hidden

I am working with a tinyMCE textarea enclosed in a div named text_editor. In my jQuery code, I have the following: $('#text_editor').hover(function(){ mouse_is_inside=true; }, function(){ mouse_is_inside=false; }) ...

Show Text When Clicking Within Separate DIVs

I have a set of three divs. One contains a Twitter icon, another holds a LinkedIn icon, and the last one is designated for displaying text upon clicking. My goal is to click on the Twitter icon and have corresponding text appear in the third div. Then, if ...

Converting JSON data from ASP.NET MVC to a Canvas.js chart

Despite my efforts to find a solution by looking through similar posts, I am unable to resolve the issue. Within my asp.net MVC controller, I have a method called public object OfferChart() List<Det> obj = new List<Det>(); foreach ...

What is the process for sending a POST request to add a Shopify ScriptTag to a Shopify Theme using a

Unique Summary I'm currently in the process of developing an app that will display a message to shoppers when specific criteria are met by manipulating the cart. Instead of using App Proxies, I've opted to utilize a ScriptTag, but I am open to e ...

Various strategies for improving the performance of a NodeJs server-side API that conducts calculations

My current project involves making an API call from the client (Angular v10) to the server-side (NodeJs v12). This API call is responsible for performing calculations on a large dataset, which typically takes around 7-10 minutes to complete. The main goal ...

The JSX element 'body' appears to be missing its closing tag

I'm currently in the process of developing a landing page using react.js. This particular page is designed for users who are not yet signed up to create an account if they wish to do so. Unfortunately, I'm encountering some errors, one of which p ...

rearrange results in ng-repeat based on specified array in AngularJS

Currently delving into Angularjs and have a quick query: I recently received an array from a user which looks like this: userPreferences = [7,5,4] Additionally, I am working with an object that uses ng-repeat to showcase various news items. The object s ...

What is the best way to store data retrieved using a model.find({}) operation?

I am currently attempting to calculate the average value of a collection in my database using Mongoose and Express. The objective is to utilize this calculated value on the "calculator" page when rendering, which is why it is embedded in a post for that sp ...

JavaScript example: Defining a variable using bitwise OR operator for encoding purposes

Today I came across some JavaScript code that involves bitwise operations, but my knowledge on the topic is limited. Despite searching online for explanations, I'm still unable to grasp the concept. Can someone provide insight into the following code ...