In my development environment, the page does not have scroll functionality, but in the production environment, it is scrollable

Whenever I open a table or any other element with overflowing content, I encounter an issue with the scrolling bar. Even though the CSS includes overflow-y: scroll;, the scroll bar on the right remains in gray and does not allow me to scroll down when the table expands due to loading 50-100 devices on the test environment. Strangely, this problem does not occur on my production environment where the scroll bar functions as expected. I have not made any recent style changes to the html, body, or table components which could explain this discrepancy. You can see the difference in behavior between the test and prod environments in the following screenshots:

'Test' Environment: https://i.stack.imgur.com/MHVei.png

'Prod' Environment: https://i.stack.imgur.com/M7BjV.png

I attempted to solve the issue by removing the overflow property from the html altogether and setting overflow-y: auto; for the body. However, this caused another problem where the 'LOGOUT' button remained misplaced within the left-side navigation when scrolled to the bottom. While setting a vh height for the table with proper overflow might be a solution, it would require restructuring the pagination layout which is currently pre-built using Vuetify library components. My primary goal is to identify the root cause of this issue since no relevant styling changes have been made recently.

Below is the code snippet:

<template>
    <v-card>
        <remove-dialog ref="removeDialog" @refresh="fetchDevices"></remove-dialog>
        <add-dialog ref="addDialog" @refresh="fetchDevices"></add-dialog>

        <v-card-title class="mb-4">
            <v-btn color="success" @click="addDevice" outlined small>
                <v-icon>mdi-plus</v-icon>
                {{ $t('action.addNew') }}
            </v-btn>
            <v-spacer></v-spacer>
            <div>{{ `You have ${devicesLeft} available devices to make ` }}</div>
            <v-spacer></v-spacer>
            <v-text-field
                class="pa-0"
                v-model="search"
                @change="fetchDevices"
                append-icon="mdi-magnify"
                :label="$t('label.search')"
                single-line
                hide-details
            ></v-text-field>
        </v-card-title>

        <v-data-table
            :headers="headers"
            :items="devices"
            :options.sync="options"
            :server-items-length="totalDevices"
            :loading="isLoading"
            :footer-props="footerOptions"
            :no-results-text="$t('noDataAvailable')"
            :no-data-text="$t('noDataAvailable')"
        >
            <template v-slot:[`item.connectedItems`]="{ item }">
                <a @click="goToConnectedItems(item.connectedItems)">{{ item.connectedItems.length }}</a>
            </template>
            <template v-slot:[`item.lastConnection`]="{ item }">
                <span v-if="item.lastConnection">{{ item.lastConnection | moment('from', 'now') }}</span>
                <span v-else>n/a</span>
            </template>
            <template v-slot:[`item.actions`]="{ item }">
                <v-tooltip top>
                    <template v-slot:activator="{ on, attrs }">
                        <v-btn color="primary" v-bind="attrs" v-on="on" @click="editDevice(item)" icon>
                            <v-icon>mdi-pencil</v-icon>
                        </v-btn>
                    </template>
                    <span>{{ $t('action.edit') }}</span>
                </v-tooltip>
                <v-tooltip top>
                    <template v-slot:activator="{ on, attrs }">
                        <v-btn color="error" v-bind="attrs" v-on="on" @click="removeDevice(item)" icon>
                            <v-icon>mdi-delete</v-icon>
                        </v-btn>
                    </template>
                    <span>{{ $t('action.delete') }}</span>
                </v-tooltip>
            </template>
        </v-data-table>
    </v-card>
</template>

No specific styles have been applied to this component.

Answer №1

I have been experimenting with back-testing the features I've implemented and finally pinpointed the issue - it's the Ionic framework and its CSS styling causing the problem. As I am using some Ionic components for a dialog preview, I included them in my code like this:

<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/ionic.bundle.css" />

The ionic.bundle.css file is causing the body overflow to be hidden, preventing scrolling. I tried isolating this CSS by injecting it directly into the specific component where I use Ionic components with <style scoped>. Surprisingly, it still affected the body element. So, I set out to identify which specific style rules were causing havoc on my page.

To tackle this, instead of loading the entire 'bundle' of styles, I decided to load the Ionic CSS files individually starting with the essential one - core.css. After that, I added additional optional styles such as normalize.css, structure.css, and typography.css one by one. Eventually, I discovered that structure.css was the culprit setting overflow: hidden on the body element. By selectively including only the necessary CSS files, I managed to fix the scrolling issue and ensure my font appeared correctly:

<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/core.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/normalize.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/typography.css" />

#ionic #ionic-vue

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

Enhancing one's comprehension of precompiling JavaScript

var foo=1; function bar(){ foo=10; return; function foo(){} } bar(); alert(foo); As I delve deeper into the inner workings of JavaScript running on the machine, I stumbled upon this code snippet. Despite my best efforts, I am perplexed as to why the ...

"Utilizing a Font Awesome icon within the dropdown list of a combobox in Ext JS

I have attempted multiple methods to add an icon in the displayfield when a combo box item is selected without success. Here is the fiddle link for anyone who would like to help me with this issue. Your assistance is greatly appreciated. View the example ...

The Intersection Observer API is not compatible with using transform: translateX()

After successfully implementing the Intersection Observer API on my website and incorporating a few transitions from an example I came across, everything seemed to be working smoothly. You can view the scale-in transition in action here: https://jsfiddle.n ...

What is the process to retrieve a function from a router javascript file using node.js?

Dealing with a web application that is not my own, I now have the task of sending out one hundred emails. Unfortunately, the code is poorly documented and written, which means I need to test it to figure out what I can and cannot do. However, I'm uns ...

Having trouble with the placement of my footer div - seeking a solution

I've been trying to center my footer, but it keeps aligning to the left. Here's a screenshot for reference Below is the code I'm working with (core.blade.php): <div class="footer"> <div class="row align-self-end& ...

Is it better to utilize a sizable JavaScript file or opt for a compact one?

I recently created a JavaScript file with over 6000 lines of code for various sections of my website. I'm debating whether to keep it as one large file or break it up into smaller parts and call them in their respective sections. What do you think? ...

Having trouble with AJAX calling an ASP.NET web method

When attempting to call an asp.net web method in my ajax request, the defined web method is structured like this: [WebMethod()] public static int DropDownIndexChanged(string selectedText) { int a = 5; // This is just for testing purposes return a; } ...

Issue: Unable to reach essential Node.js modules

After attempting to deploy Next.js on Cloudflare Pages, I encountered the following error: Error: Could not access built-in Node.js modules. It is recommended to ensure that your Cloudflare Pages project has the 'nodejs_compat' compatibility flag ...

Tips on adding a tooltip to the react-bootstrap tab element

How can I add a tooltip to the tabs in my React application using Bootstrap tabs? I have three tabs and I want a tooltip to appear when hovering over each tab. import { Tabs,Tab} from "react-bootstrap"; // inside return <Tabs variant="pills" ...

Adapting designs within an Embedded Frame - JQuery

I am dealing with a dialog type popup that appears when a button is clicked by the user. Inside this popup, there is a form that needs to be submitted in order to change the width and height of the popup using the following code: $(document).ready(functio ...

How Vue.JS can efficiently send computed values from the parent component to the child component using props

In my demo app, I have a scenario where I am generating a random number through a computed property in the root component. This random value is then passed to a child component using props. However, I am struggling to find the correct approach to update t ...

How to efficiently load 3000 objects in Openlayers using IE8

One of my clients exclusively uses IE8 and is working with an openlayers map. He is trying to load 3000 polygons onto the map, which Chrome and IE9 can handle without any issues. However, IE8 freezes when attempting to load the objects. These objects are c ...

Is it possible for me to pass a value through props that is not currently stored in the state?

Within the realm of Reactjs, imagine a scenario where there exists a <Parent> component containing state and a variable named foo, which is either 'global' or local to Parent. The question arises: Can we pass foo as props using <Child v ...

Position the larger element in the center of the smaller container element

Is there a way to center an image without it covering up the paragraph below? Using position: absolute; or float: left; can lead to layout issues. <p>This is the first paragraph</p> <p><img src="http://placekitten.com/600/280"/>&l ...

Having trouble sending a POST request with body parameters in Node.js? The error "undefined req.body.param" might be popping up when you're

I've encountered an issue with my server.js code: const bodyParser = require('body-parser'); const cors = require('cors'); const morgan = require('morgan'); var express = require('express') , http = requir ...

Toggling the visibility of divs in a dynamic layout

How can I use JQuery/JavaScript to show only the comment form for a specific post when a button or link is clicked on a page containing multiple posts divs with hidden comment forms? <div class="post"> <p>Some Content</p> <a ...

How come the selected value is different but the old value is still being shown?

Currently, I am diving into Vue with Element-UI and facing an interesting challenge today. Even though the console shows that my select's value has been updated, the page still displays the old value. Why is this happening? Below is the code for my ...

Encountering excessive re-renders while using MUI and styled components

Hey there! I recently worked on a project where I used MUI (Material-UI) and styled-components to render a webpage. To ensure responsiveness, I made use of the useTheme and useMediaQuery hooks in my web application. My goal was to adjust the font size for ...

Node.JS Logic for Scraping and Extracting Time from Text

Currently, I am working on developing a web scraper to gather information about local events from various sites. One of my challenges is extracting event times as they are inputted in different formats by different sources. I'm seeking advice on how t ...

Issue with Vue Loading Overlay Component functionality in nuxt2 .0

I've integrated the vue-loading-overlay plugin into my project. plugins/vueloadingoverlaylibrary.js import Vue from 'vue'; import Loading from 'vue-loading-overlay'; // import 'vue-loading-overlay/dist/vue-loading.css'; ...