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

fix(vicon.ts): svg size didn't match default icon size #10507

Merged
merged 24 commits into from
Feb 13, 2020

Conversation

rachael-smith
Copy link
Contributor

default font size was 24 but svg size was set to 32 making alignment for svgs off if not specified

Description

default font size was 24 but svg size was set to 32 making alignment for svgs off if not specified
resolves bug report #10480

Motivation and Context

fixes #10480

How Has This Been Tested?

went through snapshot test and tested locally by testing default and changing size in v-icon tag

Markup:

can throw this in playground https://codepen.io/myleslee/pen/OJVJRwB?editors=1010 (also pasted below)

<template>
  <v-container>
<div id="app">
  <v-app id="inspire">
    <v-form>
      <v-container>
        <v-row>

          <v-col cols="12" sm="6">
            <v-text-field v-model="message1" label="Regular" clearable append-icon="event">
              <template v-slot:prepend>
                <v-icon>event</v-icon>
              </template>
              <template v-slot:prepend-inner>
                <v-icon @click="alert('a')">
                  M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z
                </v-icon>
              </template>
              <template v-slot:append-outer>
                <v-icon @click="alert('a')">
                  clear
                </v-icon>
              </template>
            </v-text-field>
          </v-col>
        </v-row>
      </v-container>
    </v-form>
  </v-app>
</div>
  </v-container>
</template>

<script>
export default {
  data () {
    return {
      message1: 'icons in lower position are svgs',
      message2: 'Hey!',
      message3: 'Hey!',
      message4: 'Hey!',
    }
  }, methods: {
    alert(val) {
      alert(val)
    }
  }
}
</script>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and backwards compatible changes and next for non-backwards compatible changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

height and width of svgs were defaulted to 32 and default icon size was 24 which caused alignment
issues

fix 10480
@rachael-smith rachael-smith requested a review from KaelWD February 7, 2020 14:01
@rachael-smith
Copy link
Contributor Author

same as #10497 just cleaned up

default size was 18 while all other icons were 24 causing alignment issues

fix 10480
@rachael-smith
Copy link
Contributor Author

updated vchip which was also having the same issue as pointed out by @funkybg

Copy link
Member

@KaelWD KaelWD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More playground:
<template>
  <v-container>
    <v-row>
      <v-col cols="12">
        <v-text-field v-model="message1" label="Regular" clearable append-icon="event">
          <template v-slot:prepend>
            <v-icon>event</v-icon>
          </template>
          <template v-slot:prepend-inner>
            <v-icon @click="alert('a')">
              M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z
            </v-icon>
          </template>
          <template v-slot:append-outer>
            <v-icon @click="alert('a')">
              clear
            </v-icon>
          </template>
        </v-text-field>
      </v-col>

      <v-col cols="12">
        <v-chip close>I'm a chip</v-chip>
      </v-col>

      <v-col cols="12">
        <v-card width="400" class="mx-auto mt-6">
          <v-toolbar color="deep-purple accent-4" dark>
            <v-app-bar-nav-icon></v-app-bar-nav-icon>

            <v-toolbar-title>New Chat</v-toolbar-title>

            <v-spacer></v-spacer>

            <v-btn icon>
              <v-icon>{{ mdiMagnify }}</v-icon>
            </v-btn>
          </v-toolbar>

          <v-list subheader>
            <v-subheader>Recent chat</v-subheader>

            <v-list-item @click.stop>
              <v-list-item-icon>
                <v-icon color="deep-purple accent-4">{{ mdiMessage }}</v-icon>
              </v-list-item-icon>

              <v-list-item-content>
                <v-list-item-title>Jason Oner</v-list-item-title>
              </v-list-item-content>

              <v-list-item-icon>
                <v-icon @click.stop>{{ mdiClose }}</v-icon>
              </v-list-item-icon>
            </v-list-item>
          </v-list>
        </v-card>
      </v-col>
    </v-row>
  </v-container>
</template>

<script>
  import { mdiMessage, mdiClose, mdiMagnify } from "@mdi/js";

  export default {
    data () {
      return {
        message1: 'icons in lower position are svgs',
        message2: 'Hey!',
        message3: 'Hey!',
        message4: 'Hey!',
        mdiMessage,
        mdiClose,
        mdiMagnify
      }
    },
    methods: {
      alert(val) {
        alert(val)
      }
    }
  }
</script>

packages/vuetify/src/components/VChip/_variables.scss Outdated Show resolved Hide resolved
@rachael-smith
Copy link
Contributor Author

@KaelWD should be good now

@rachael-smith
Copy link
Contributor Author

@KaelWD should be good

@KaelWD KaelWD requested a review from johnleider February 13, 2020 03:23
@johnleider johnleider merged commit 2045295 into vuetifyjs:master Feb 13, 2020
Logikgate pushed a commit to flypapertech/vuetify that referenced this pull request Feb 19, 2020
…fyjs#10507)

fixes vuetifyjs#10507

* fix(vicon.ts): svg size didn't match default icon size

height and width of svgs were defaulted to 32 and default icon size was 24 which caused alignment
issues

* fix(vchip_variables.scss): update default to match other icons

default size was 18 while all other icons were 24 causing alignment issues

* fix conditional

* take out iconfont in index

* take out console logs

* add to vchip test

* updating vIcon test

* take out change to vchip test

* fix(vicon.ts): svg size didn't match default icon size

height and width of svgs were defaulted to 32 and default icon size was 24 which caused alignment
issues

* fix(vchip_variables.scss): update default to match other icons

default size was 18 while all other icons were 24 causing alignment issues

* fix conditional

* take out iconfont in index

* take out console logs

* add to vchip test

* updating vIcon test

* take out change to vchip test

* removed test 3 due to not using it

* change to size 18 in props instead of attrs

* take out console log and extra spaces and update to master

* missed one space
whoistobias pushed a commit to whoistobias/vuetify that referenced this pull request Feb 26, 2020
…fyjs#10507)

fixes vuetifyjs#10507

* fix(vicon.ts): svg size didn't match default icon size

height and width of svgs were defaulted to 32 and default icon size was 24 which caused alignment
issues

* fix(vchip_variables.scss): update default to match other icons

default size was 18 while all other icons were 24 causing alignment issues

* fix conditional

* take out iconfont in index

* take out console logs

* add to vchip test

* updating vIcon test

* take out change to vchip test

* fix(vicon.ts): svg size didn't match default icon size

height and width of svgs were defaulted to 32 and default icon size was 24 which caused alignment
issues

* fix(vchip_variables.scss): update default to match other icons

default size was 18 while all other icons were 24 causing alignment issues

* fix conditional

* take out iconfont in index

* take out console logs

* add to vchip test

* updating vIcon test

* take out change to vchip test

* removed test 3 due to not using it

* change to size 18 in props instead of attrs

* take out console log and extra spaces and update to master

* missed one space
@lock lock bot locked as resolved and limited conversation to collaborators Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] [VTextField] Clear icon (svg) mis-alignment
5 participants