The Vuetify v-btn within the v-bottom-navigation remains in an active state even when it has not

I am encountering an issue with a button in the bottom navigation bar of my Vuetify application. I have set up several buttons as routes in Nuxtjs, which become active when the corresponding page is visited. However, there is a button in the bottom nav bar that is not a route; instead, it is meant to open a v-navigation-drawer. The problem arises when I click on this button to open the drawer, as upon closing the drawer, both the active button for the current page and the drawer-activating button remain active. I want the drawer-activating button to never stay active.

When I am on the home page of the app, the issue becomes apparent.

Here is a preview of the bottom nav before clicking the button to open the v-navigation-drawer

After closing the v-navigation-drawer, the rightmost button remains active despite it being the button to open the drawer. It should not be active after closing the drawer, but it requires clicking another button to deactivate it.

I have attempted various solutions including defining a custom active class, using the exact prop, and implementing a watcher to modify the active value in the nav bar. Unfortunately, none of these methods have resolved the issue.

The problematic section of code includes only the home and profile buttons:

<v-bottom-navigation
      app
      fluid
      grow
      color="primary"
      class="d-flex d-sm-none"
>
    <v-btn
      value="home"
      to="/home"
      nuxt
      exact
    >
        <v-icon>
            mdi-home
        </v-icon>
    </v-btn>

    
    <v-btn
      value="profile"
      exact
      @click="showProfileNavDrawer"
    >
        <v-icon>
          mdi-account-circle
        </v-icon>
    </v-btn>
</v-bottom-navigation>

Even after closing the navigation drawer, the profile button remains active alongside another button that is active due to vue's router. Deactivating the profile button requires selecting another button.

Any suggestions on how to resolve this issue would be appreciated.

EDIT After some investigation, I believe I have identified the issue. It seems to be a limitation of Vuetify's bottom navigation, which is primarily designed for navigation purposes. The button in question, lacking an assigned route and serving the sole purpose of opening a navigation drawer, temporarily associates itself with the current route until a different route is navigated to and the bottom navigation bar's state is altered. While this explanation may not be definitive, it appears to align with the observed behavior.

Regrettably, my lack of expertise in CSS hindered me from resolving the problem, prompting me to alter my web application's design instead. I apologize to those who were seeking a solution to this issue.

Answer №1

Hey @genp, have you checked out the documentation for v-btn? It mentions that using the exact prop without specifying a route will cause it to match every route. Could this be why your button is triggering its active state? Try removing the exact prop from the button in the navigation and see if that makes a difference. Check out the docs here.

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

Is there a way to use an Angular expression inside an HTML document to determine if a variable is a boolean type?

I'm working with an element in my HTML where I need to determine the type of a variable, specifically whether it's a boolean or not. <button process-indicator="{{typeof(button.processIndicator) === 'boolean' ? 'modalProcess&apo ...

Receiving a 200 response code, however the controller's store() method is not being accessed

Recently, I made the decision to switch from using a form in a blade file to a Vue-based form that utilizes Axios for posting data. After making these changes, I encountered an issue where I receive a 200 response, but my controller's store() method i ...

AngularJS directive created for validation on blur

I am striving to replicate some of the features found in Angular 1.3.X for the app I am developing, with a particular focus on ensuring compatibility with IE 8. Unfortunately, this constraint means that I cannot utilize version 1.3.X. I have encountered di ...

Sharing a unique JSON message on Slack via a webhook

Is there a way to send a custom JSON message with indentation using a Slack webhook in a Node.js app? var Slack = require('slack-node'); var JsonMessage = process.argv[2]; webhookUri = "https://hooks.slack.com/services/XXXX/xxxx/xxxxxxxx"; sla ...

Construct a div element using JSON information

I am retrieving information from a database and organizing it into a JSON array. Here is the data that I have: [{"id":"0","name":"red","percentage":"60"},{"id":"1","name":"blue","percentage":"58"},{"id":"4","name":"green","percentage":"12"}] The structu ...

I'm unsure of the most efficient way to condense this statement

$(document).ready(function(){ if ($(window).width() <961){ $('.item').on('click',function(){ /*---do something---*/ }) }else{ $('.item').on('click',function(){ ...

HTML5 Audio using AudioJS may not function reliably when loaded remotely

I have been encountering frustrating issues with loading audio tags for a while now. Despite spending nearly two weeks trying to solve the problems, every fix seems to create another one. My webpage includes an < audio > tag that utilizes audio.js t ...

Is there a way to make this eval() function function properly in Internet Explorer?

My JavaScript code is fetching another JavaScript "class" from a different XHTML page. The fetched JavaScript looks like this: (function() { this.init = function() { jQuery("#__BALLOONS__tabs").tabs(); }; }) Once the f ...

What is the best way to structure time and avoid mentioning the server name?

After struggling for days, I am reaching out for help as I encounter a null error and difficulty changing the time format in my code below. Despite my efforts, this issue seems unsolvable. Error #1 ------------------------------ (node:8844) UnhandledPromi ...

Leveraging the "dialogclose" event within jQuery Mobile

Is there a way to change an image once it is clicked and change back when the dialog it links to is closed? I found a potential solution on this site, but after modifying it for my needs, it doesn't seem to work. Can anyone help me figure out what I a ...

Retrieving data from multiple mongo collections and merging selected attributes from the output

I'm attempting to query a Mongo collection, extract an attribute from each object returned, use that attribute to retrieve data from another collection, and then combine the data. I am unsure of how to achieve this on mongoDB. To break it down, what I ...

Retrieve both the keys and values from a deeply nested JSON object

My goal is to retrieve JSON data with a specific structure as shown below: {"Points": {"90": {"0": {"name": "John Phillip", "slug": "john"}, {"1&q ...

Having trouble sending a POST request from my React frontend to the Node.js backend

My node.js portfolio page features a simple contact form that sends emails using the Sendgrid API. The details for the API request are stored in sendgridObj, which is then sent to my server at server.js via a POST request when the contact form is submitted ...

Avoiding remote submission in Grails forms: Best practices

<g:formRemote name="form1" update="homeBody" url="[controller: 'xxx', action:'aaa']"> <Button type="submit">Save</Button> </g:formRemote> I am facing a scenario where I need to place a text field o ...

Instructions on submitting a form containing multiple select lists using the enter key

After researching various threads, I have come across solutions using the JS onkeypress function to trigger actions with input fields. However, in my case, I need to implement this functionality with a form that consists of multiple select lists instead of ...

My CSS files are not being included by grunt-bower-install

As someone who is relatively new to bower and grunt, I'm struggling with some basic tasks. After running bower install --save bootstrap, my goal is to use grunt-bower-install to update my js & css files as per the instructions on their documentat ...

Sending various values from ASP.NET to a javascript function

I am currently attempting to pass multiple parameters (eventually 4 total) into a JavaScript function from my ASP.NET code behind. In the ASCX file, I have defined the function as follows: function ToggleReportOptions(filenameText, buttonText) { /*stuff ...

The server mistakenly sent the resource as a Stylesheet even though it was interpreted differently

Dear Fellow Coders, Could anyone lend a hand? I encountered this issue on my website after uploading it to my FTP: "Resource interpreted as Stylesheet but transferred with MIME type text/plain" </head> <body> <div class= "navbar navbar ...

The integration of Google Translate with Javascript on HtmlEditorExtender is experiencing difficulties and is not functioning properly

I implemented the use of a text box with ajaxtoolkit HtmlEditorExtender (Rich textbox) to translate English to Gujarati using Google translation Javascript. The translation function works perfectly with the regular text box, but encounters issues when used ...

The difficulties of utilizing vue-i18n within Vue's data() and its lack of reactivity

I've been utilizing the vue-i18n plugin in a Vue project, and I've encountered some confusion when working with data in the Vue data alongside i18n. The issue arises when the locale is changed, as the data does not behave reactively. I attempted ...