Skip to content

Commit

Permalink
Fixed #3905 - Button: No label
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 27, 2023
1 parent 2141a3a commit 3fbd5c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions components/lib/avatar/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<template>
<div :class="containerClass" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('root')">
<slot></slot>
<template v-if="!$slots.default">
<slot>
<span v-if="label" class="p-avatar-text" v-bind="ptm('label')">{{ label }}</span>
<component v-else-if="$slots.icon" :is="$slots.icon" class="p-avatar-icon" v-bind="ptm('icon')" />
<span v-else-if="icon" :class="['p-avatar-icon', icon]" v-bind="ptm('icon')" />
<img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="ptm('image')" />
</template>
</slot>
</div>
</template>

Expand Down
5 changes: 2 additions & 3 deletions components/lib/button/Button.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<button v-ripple :class="buttonClass" type="button" :aria-label="defaultAriaLabel" :disabled="disabled" v-bind="ptm('root')">
<slot></slot>
<template v-if="!$slots.default">
<slot>
<slot v-if="loading" name="loadingicon" :class="loadingIconStyleClass">
<span v-if="loadingIcon" :class="[loadingIconStyleClass, loadingIcon]" v-bind="ptm('loadingIcon')" />
<SpinnerIcon v-else :class="loadingIconStyleClass" spin v-bind="ptm('loadingIcon')" />
Expand All @@ -11,7 +10,7 @@
</slot>
<span class="p-button-label" v-bind="ptm('label')">{{ label || '&nbsp;' }}</span>
<span v-if="badge" :class="badgeStyleClass" v-bind="ptm('badge')">{{ badge }}</span>
</template>
</slot>
</button>
</template>

Expand Down
5 changes: 2 additions & 3 deletions components/lib/chip/Chip.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<template>
<div v-if="visible" :class="containerClass" :aria-label="label" v-bind="ptm('root')">
<slot></slot>
<template v-if="!$slots.default">
<slot>
<img v-if="image" :src="image" v-bind="ptm('image')" />
<component v-else-if="$slots.icon" :is="$slots.icon" class="p-chip-icon" v-bind="ptm('icon')" />
<span v-else-if="icon" :class="['p-chip-icon', icon]" v-bind="ptm('icon')" />
<div v-if="label" class="p-chip-text" v-bind="ptm('label')">{{ label }}</div>
</template>
</slot>
<slot v-if="removable" name="removeicon" :onClick="close" :onKeydown="onKeydown">
<component :is="removeIcon ? 'span' : 'TimesCircleIcon'" tabindex="0" :class="['p-chip-remove-icon', removeIcon]" @click="close" @keydown="onKeydown" v-bind="ptm('removeIcon')"></component>
</slot>
Expand Down

0 comments on commit 3fbd5c0

Please sign in to comment.