The Vue 3 page does not allow scrolling unless the page is refreshed

I am encountering an issue with my vue3 web app. Whenever I attempt to navigate to a page using

<router-link to ="/Dashboard"/>

Here is the code for Dashboard.vue:

<template>
  <div class="enquiry">
    <div class="row">
      <div class="col-6" v-for="(p, index) in keyAreas" :key="index">
        <div class="card" style="margin-bottom: 10px">
          <div class="card-body">
            <h2 class="card-title">
              {{ p.number }}
              <span class="card-title" style="float: right">{{ p.title }}</span>
            </h2>
            <h5 class="card-text">
              Properties for rent
              <span class="card-title" style="float: right; margin-top: -5px">
                <Doughnut
                  :chart-data="updateChartData(p.number, totalPropertiesNumber)"
                  :width="80"
                  :height="80"
                />
              </span>
            </h5>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { ref } from "vue";
import { projectDatabase } from "../../firebase/config";
import getUser from "../../composables/getUser";
import {
  Chart as ChartJS,
  Title,
  Tooltip,
  Legend,
  ArcElement,
  CategoryScale,
} from "chart.js";

ChartJS.register(Title, Tooltip, Legend, ArcElement, CategoryScale);
export default {
  setup() {
    //to get user info e.g email and display name
    const { user } = getUser();
    const company = ref("");
    const keyAreas = ref([]);

    //all LGAs
    const allLGAs = ref([
      { title: "Abuja", number: 0 },
      { title: "Banana Island", number: 0 },
      { title: "Bluewaters Lagos", number: 0 },
      { title: "Benin City", number: 0 },
      { title: "Eko Atlantic", number: 0 },
    ]);

    //Query Function for Specific Locations
    const filterLocation = (item, query, filter) => {
      if (item[filter] === query) {
        return true;
      }
      return false;
    };

    //reference from firebase for user company
    projectDatabase
      .ref("users")
      .child(user.value.uid)
      .child("company")
      .on("value", (snapshot) => {
        company.value = snapshot.val();

        //loop through all LGAs array and update dashboard by filtering each LGA for its properties in its field
        allLGAs.value.forEach(function (p) {
          p.number = Object.keys(snapshot.val())
            .map((key) => {
              snapshot.val()[key].id = key;
              return snapshot.val()[key];
            })
            .filter((item) => {
              return filterLocation(item, p.title, "location");
            }).length;
          if (p.number > 0) {
            keyAreas.value.push(p);
          }
        });
      });

    return {
      allLGAs,
      company,
      keyAreas,
    };
  },
};
</script>

The problem arises every time I move to a new page, causing the page to freeze. I must refresh the page to visualize all items in the v-for loop. This issue impacts about three pages on the web app. Is there any solution to this problem?

Despite disabling all browser extensions and similar measures, the problem persists. Could it be due to the size of the array being loaded in the v-for?

Answer №1

The original poster was able to resolve their problem by discovering that Bootstrap v5 includes a new class called offcanvas. This class had the following CSS properties:

overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;

Enabling scrolling restored functionality to the issue.

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

Creating a dropdown menu and adjusting the content below

Feeling stuck in one place with my code here: link The side navbar animation is almost what I want, but clicking one option opens all of them. Hoping for a similar effect like this page: link $(document).ready(function() { $('.interfejs, .proces ...

Issue with image display in Chrome caused by Flexbox styling

I recently set up a flexbox for my website, but I'm encountering an issue in Chrome. When the viewport is smaller than the width of two images, the entire site zooms out and everything gets distorted. However, this problem doesn't occur in Firefo ...

Implement a unique feature for specific days using jQuery UI Datepicker with a customized class

Looking to highlight a range of days horizontally in jQuery UI Datepicker with the multiselect plugin. To achieve this, I am utilizing the :before and :after pseudoelements of the a tags. .ui-state-highlight a:before, .ui-state-highlight a:after { con ...

Captivating Images accompanied by Descriptive Captions

I was wondering if there is a straightforward method using only CSS and HTML to address this particular issue. I am in the process of creating a marquee that displays images within a fixed-width div. The number of images exceeds the capacity of the div, ...

Styling code for a layout with two columns aligned to the left using

I am looking to create a layout where two pieces of text are displayed side by side in columns using CSS. The left-hand column will have variable length text, while the right-hand column will have fixed length text. The desired layout should show the two ...

The issue of conflicting stylesheets is causing alignment and height discrepancies when using multiple icons

Is there a way to align icons from different stylesheets to have the same height? When attempting to use icons from separate stylesheets, I encountered a height issue where one icon left space at the top and bottom while another appeared correctly aligned. ...

Update the class name of an element depending on the URL

Hey there! I'm working on customizing the style of some elements (specifically tds within a table) based on the current URL. Here are the pages I'm targeting: http:\\domain\site\welcome.html http:\\domain\site& ...

Which is the better approach for performance: querying on parent selectors or appending selectors to all children?

I currently have 2 mirror sections within my DOM, one for delivery and another for pickup. Both of these sections contain identical content structures. Here's an example: <div class="main-section"> <div class="description-content"> ...

Arranging two tables, one slightly misplaced from the other

I have been searching through various websites, but I cannot find a solution to the specific issue I am facing. I am attempting to create a web page with a table aligned to the left side while keeping the rest centered. However, when I align items in the ...

Placing an icon and a title on the same baseline

I'm working on a new website design and I really like the layout shown in this image: https://i.stack.imgur.com/QuVRZ.png I've been struggling to align the icon with the title in a responsive manner. Here are some of the approaches I've att ...

The Heroku application is rendering with different CSS and positioning compared to the local development environment

My locally hosted site has correct CSS and positioning, but once deployed to Heroku, it appears to lose some of its CSS styles. I am using the MERN Stack for this project. I suspect that the issue may be related to my node_modules, even though I have them ...

What is the best way to implement an array in Vuetify?

The content in the array is not displaying in the correct columns as expected from this code: <div id="app"> <v-app> <v-simple-table> <template v-slot:default> <thead> <tr> < ...

"Enhance your browsing experience with Chrome by automatically changing the background when

I am currently using Chrome with a CSS3 background. <h4 class="title-name clearfix"><a href="****************">Fairy Tail - LUCY</a> </h4> My issue is that when I hover my mouse over the title, the ba ...

I am struggling with grasping the concept of the event system

I'm encountering an issue with the following code snippet: <template> <div class="chart" v-bind:style="chartStyleObject" v-on:mousedown.left="initHandleMousedown($event)" v-on:mouseup.left="initHandleMouseu ...

Vue alert: Issue with rendering - TypeError: Unable to access property 'NomeStr' as it is undefined

I'm having trouble displaying the 'NameSrt' item array value in my template, and I keep encountering this issue: vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in render: "TypeError: Cannot read property 'NomeStr' of undefined" The ...

What is the best way to eliminate the right margin from my div element?

On my contact page, there's a div with the ID of contactdetails that appears to have a margin on the right side when viewed in Chrome's developer tools. This margin is causing some layout issues, specifically preventing me from placing the Google ...

Leveraging module in vue.config.js

I'm encountering an issue while trying to implement the code below in my vue.config.js file. The error message indicates that the module is not allowed. I understand that there are configureWebpack and chainWebpack options available, but I'm unsu ...

Ways to verify whether a vue instance is empty within a .vue file by utilizing the v-if directive

I am facing an issue with a for-loop in Vue that iterates through a media object using v-for to check if it contains any images. Everything is working correctly, but I want to display a div below the loop saying "There is no media" when the object is empty ...

Is there a way to adjust the background color of the clicked tab with divs and revert the others back to their original color?

<span class="row top-bar-left align-items-center" style="width: 80%; float:left"> <div tabindex="1" class="link tab" routerLink="details" routerLinkActive="active" [qu ...

Finding the location of an "Apply" button on an Angular HTML page

There is an issue with the positioning of the apply button in the filter bar. Sometimes it displays in the next row instead of alongside the other filters. How can I determine the exact position of this apply button within the HTML page? <div class=&quo ...