Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(VNumberInput): support append/prepend inner slots/icons #20812

Closed
wants to merge 1 commit into from

Conversation

yuwu9145
Copy link
Member

@yuwu9145 yuwu9145 commented Dec 27, 2024

Description

Add proper support of append/prepend inner slots/icons in VNumberInput

fixes #20782

Markup:

<template>
  <v-app>
    <v-container>
      <v-number-input
        append-inner-icon="mdi-map-marker"
        prepend-inner-icon="mdi-map-marker"
      />
      <v-number-input
        append-inner-icon="mdi-map-marker"
        prepend-inner-icon="mdi-map-marker"
        hide-input
      />
    </v-container>
  </v-app>
</template>

<style>
  /*
  uncomment to revert to default v-field-preppended padding


  .v-field.v-field--prepended {
    padding-inline-start: 12px;
  }

  */
</style>




@yuwu9145 yuwu9145 marked this pull request as ready for review January 10, 2025 12:22
@yuwu9145 yuwu9145 requested review from J-Sek and KaelWD January 10, 2025 12:23
@J-Sek
Copy link
Contributor

J-Sek commented Jan 10, 2025

I would consider additional margin 12px to better support use cases when controls are disabled (either because of readonly or the value being equal min or max.

playground
<template>
  <v-app>
    <v-container class="d-flex ga-6">
      <v-card class="pa-6" min-width="400">
        <h3>Value within range</h3>
        <h5>without margin</h5>
        <v-number-input :model-value="123.5" append-inner-icon="mdi-lock" />
        <v-number-input :model-value="123.5" control-variant="stacked" append-inner-icon="mdi-lock" />
        <v-number-input :model-value="123.5" control-variant="split" append-inner-icon="mdi-lock" />
        <h5>with margin-right: 12px</h5>
        <div class="add-margin">
          <v-number-input :model-value="123.5" append-inner-icon="mdi-lock" />
          <v-number-input :model-value="123.5" control-variant="stacked" append-inner-icon="mdi-lock" />
          <v-number-input :model-value="123.5" control-variant="split" append-inner-icon="mdi-lock" />
        </div>
      </v-card>
      <v-card class="pa-6" min-width="400">
        <h3>min='0'</h3>
        <h5>without margin</h5>
        <v-number-input :min="0" append-inner-icon="mdi-lock" />
        <v-number-input :min="0" control-variant="stacked" append-inner-icon="mdi-lock" />
        <v-number-input :min="0" control-variant="split" append-inner-icon="mdi-lock" />
        <h5>with margin-right: 12px</h5>
        <div class="add-margin">
          <v-number-input :min="0" append-inner-icon="mdi-lock" />
          <v-number-input :min="0" control-variant="stacked" append-inner-icon="mdi-lock" />
          <v-number-input :min="0" control-variant="split" append-inner-icon="mdi-lock" />
        </div>
      </v-card>
      <v-card class="pa-6" min-width="400">
        <h3>readonly</h3>
        <h5>without margin</h5>
        <v-number-input :model-value="123.5" readonly append-inner-icon="mdi-lock" />
        <v-number-input :model-value="123.5" control-variant="stacked" readonly append-inner-icon="mdi-lock" />
        <v-number-input :model-value="123.5" control-variant="split" readonly append-inner-icon="mdi-lock" />
        <h5>with margin-right: 12px</h5>
        <div class="add-margin">
          <v-number-input :model-value="123.5" readonly append-inner-icon="mdi-lock" />
          <v-number-input :model-value="123.5" control-variant="stacked" readonly append-inner-icon="mdi-lock" />
          <v-number-input :model-value="123.5" control-variant="split" readonly append-inner-icon="mdi-lock" />
        </div>
      </v-card>
    </v-container>
  </v-app>
</template>

<style>
.add-margin .v-number-input__control {
  margin-right: 12px;
}
</style>

image

@MajesticPotatoe MajesticPotatoe added T: feature A new feature labs Must be completed for this component to leave labs C: VNumberInput labels Feb 14, 2025
@KaelWD
Copy link
Member

KaelWD commented Feb 17, 2025

Replaced with #19908

@KaelWD KaelWD closed this Feb 17, 2025
@KaelWD KaelWD deleted the feat-20782 branch February 17, 2025 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VNumberInput labs Must be completed for this component to leave labs T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants