Skip to content

Commit cd25910

Browse files
committed
fix: correct label display for single-word inputs in UAvatar component
1 parent dfb2289 commit cd25910

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/ui.image-avatar/UAvatar.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ const avatarRef = useTemplateRef<HTMLDivElement>("avatar");
4242
const labelFirstLetters = computed(() => {
4343
if (!props.label) return "";
4444
45-
if (!props.label.includes(" ")) {
46-
return props.label;
47-
}
48-
4945
const [firstWord, secondWord] = props.label.split(" ");
5046
5147
const firstWordLetter = firstWord ? firstWord[0].toUpperCase() : "";

src/ui.image-avatar/tests/UAvatar.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("UAvatar.vue", () => {
2626
// Label prop with a single word
2727
it("displays only first letter when label has only one word", () => {
2828
const label = "John";
29-
const expectedText = "John";
29+
const expectedText = "J";
3030

3131
const component = mount(UAvatar, {
3232
props: {

0 commit comments

Comments
 (0)