Unable to eliminate padding within Vuetify's expansion panel

When you click the button labeled "KOMMENTAR HINZUFÜGEN," a text input field is displayed. However, I am facing an issue with the layout – there is unwanted white padding below the black line, and I want the text field to occupy the entire panel. I have tried setting margins and paddings to 0 in the CSS, but it hasn't resolved the problem. Below is the code snippet:

<template>
  <v-expansion-panels>
    <v-expansion-panel class="expansion-panel">
        <v-btn @click.prevent="showTextField = !showTextField" color="gray">Kommentar hinzufügen (optional)</v-btn>
        <v-text-field v-if="showTextField" v-model="comment" label="Kommentar" class="comment-field" ref="inputField" @click="$refs.inputField.focus()" autofocus></v-text-field>
    </v-expansion-panel>
  </v-expansion-panels>
</template>

<style scoped>
  .comment-field {
    width: 25em;
    height: 20em;
    margin: 0;
  }

  .expansion-panel {
    padding: 0;
  }
</style>

Answer №1

v-text-field is designed for single-line inputs.

To achieve multi-line input functionality, you can utilize v-textarea with the attribute hide-details: auto:

<script setup lang="ts">
  import { ref } from 'vue'
  const showTextField = ref(false)
  const comment = ref('')
</script>

<template>
  <v-expansion-panels>
    <v-expansion-panel>
      <v-btn @click.prevent="showTextField = !showTextField" color="grey">
        Add Comment (optional)
      </v-btn>
      <v-textarea
        v-if="showTextField"
        v-model="comment"
        label="Comment"
        hide-details="auto"
        autofocus
      ></v-textarea>
    </v-expansion-panel>
  </v-expansion-panels>
</template>

Try out the code in this Playground: Playground Link

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

Fix the issue of the screen bouncing around when the scroll bar is visible

When my modal popup appears on screen, I am using the CSS property overflow: hidden to eliminate the scrollbar. To ensure that the screen does not shift when the scrollbar disappears, I am calculating the scrollbar width using JavaScript and adding paddin ...

Efficiently Populating Arrays Without Blocking

Let's dive into the scenario... Here is the template for our component <template> <div> <loader v-show="loading"></loader> // display loading animation <div v-show="!loading"> <div v-for="group in groups ...

What is preventing me from retrieving data from MySQL on a new page using Vue?

My apologies for what may seem like a common inquiry, but I am struggling to achieve a specific functionality. I would like to be able to click on an 'a' tag and have it open a new page displaying an article based on the ID fetched from MySQL Da ...

"Exploring the relationship between Vue checkbox components: parent and

Currently, I am working on a checkbox group where the behavior is such that if the parent checkbox is checked, all the child checkboxes will also be checked. Similarly, if a child checkbox is checked, the parent checkbox should also get checked, and so on. ...

Having issues with the forEach and map functions not iterating through every item in an async-await function in Vue.js?

My orders array contains a number of meal plans, each with items inside. I'm trying to process all orders as paid in the inner loop when I click on place orders. However, the code is only processing some and leaving others behind. Below is my implem ...

Issues arising when using December in a JavaScript function to determine weekends

My function is used to determine if a day falls on the weekend or not, and it works perfectly for most months except December. What could be causing this issue? weekEnd: function(date) { // Determine if it's a weekend var date1 = new Dat ...

The Bootstrap dropdown is causing a paragraph to have an overflow issue

When my paragraph text contains too many words, it tends to overlap. Take a look at the code snippet below: <a class="dropdown-item content btnOpen"> <div class="col-sm-12"> <div class="row"> <div class="col-md-2 p-1"> ...

Disabling the strong pressure effect on Safari for iPhone 6s: A step-by-step guide

How can I prevent the peak effect (strong pressure's impact with Safari on iPhone 6s) on the "a" element in this code (bootstrap environment)? <article> <div class="gall-thumbnail"> <a data-toggle="modal" href="mod1#"> ...

Adjusting the width of images on Woocommerce

I am struggling to make the images in my Woocommerce store look more uniform. Despite searching on Google, I haven't been able to find a solution to my problem. Currently, the images have varying heights, and I would like them all to be 400px tall. Y ...

Errors are being displayed in the console when attempting to use Vuex getters in a component. This is happening because the Vuex state properties are still null at the time the getters

When assigning results from GET requests to my Vuex state properties, it's expected that they won't be available instantly. However, I have a getter like the following: findChampion: (state) => (id) => { let championId = id.toString() ...

Sort slider items using Show/Hide feature in bxSlider

I am using a bxslider on my website with specific settings: $('#carousel').bxSlider({ slideWidth: 146, minSlides: 2, maxSlides: 6, speed:500, adaptiveHeight: true, moveSlides:3, infiniteLoop : false, hideContr ...

The issue with style.background not functioning in Internet Explorer is causing complications

I am currently developing a JavaScript game that involves flipping cards. However, I have encountered an issue with the style.background property. It seems to be functioning correctly in Chrome but not in Internet Explorer. Here is the problematic code sn ...

When I tried to open a website using the "target=_blank" attribute on the Chrome mobile version for iPhone, I noticed some strange viewport behavior

[Update] I encountered the following issue: I once had a website. It functioned well, except when opened in a new tab with target "_blank." When accessing the site directly, everything appeared normal enter image description here However, when accessed ...

tap into adhesive, translucent screen

I designed a webpage with an iframe at the bottom that I set to be transparent so that overlapped elements are visible. However, I encountered an issue where the links beneath the iframe were not clickable unless I disabled pointer-events for the iframe. ...

Determining the container height for every two-image row

I am currently working on a project for this website. My focus right now is on resizing vertical images using the following script: function Gallery(selector) { this.add_module = function (type, image) { var portrait_text = image.next('.portr ...

What are some best practices for integrating CSS grid layouts with React for optimal results?

My current project involves developing a Single Page Application using ReactJs and CSS grid layouts for styling components. However, I've encountered an issue where the two technologies do not seamlessly integrate: CSS grid layouts are typically appli ...

Tips for adjusting the size of an SVG using percentages

I have multiple tables with data in them, each sized using percentage and resizable. I want to add SVG images to each table without affecting the table size. When I tried setting the sizing like this: <svg xmlns="http://www.w3.org/2000/svg" xml:space=" ...

What is the best way to implement momentJS globally in VueJS 2?

Currently working with Vue.js version 2.6.11 Trying to set up in main.js as follows: import moment from 'moment' moment.locale('nl'); Object.definePrototype(Vue.prototype, '$moment', { value: moment }); Encountering an error ...

Is there a way for me to eliminate the white background from my transparent icons?

I have some forum icons with a white background that I want to make transparent. Can anyone suggest a way to achieve this using CSS or a software tool? Thank you. ...

Tips for avoiding unnecessary white space at the bottom of an HTML paragraph when using maximum width

Whenever I set a <p> tag with a specific max-width, the paragraph sometimes ends up taking more horizontal space than necessary due to text formatting. Is there a way to make it shrink to fit the minimum required horizontal space without altering the ...