Skip to content

Commit

Permalink
Merge pull request #1055 from PrefectHQ/fix/tags-input-display
Browse files Browse the repository at this point in the history
Fix: tags input not taking advantage of available width
  • Loading branch information
brandonreid authored Dec 18, 2023
2 parents af55b6f + 2897328 commit b98be7e
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 130 deletions.
14 changes: 11 additions & 3 deletions demo/sections/components/Tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{ title: 'Multiple' },
{ title: 'Using p-tag-wrapper' },
]"
use-resizable
>
<template #basic>
<div class="tags__list">
Expand Down Expand Up @@ -34,9 +35,9 @@

<template #using-p-tag-wrapper>
<div class="flex flex-col gap-3">
<p-tag-wrapper class="h-[48px]" :tags="numberArr" justify="left" />
<p-tag-wrapper :tags="numberArr" justify="left" />

<p-tag-wrapper class="h-[48px]" :tags="numberArr">
<p-tag-wrapper :tags="numberArr">
<template #tag="{ tag }">
<p-tag icon="Prefect">
{{ tag }}
Expand All @@ -50,11 +51,18 @@
</template>
</p-tag-wrapper>

<p-tag-wrapper class="h-[48px]" justify="right">
<p-tag-wrapper justify="right">
<p-tag v-for="i in 20" :key="i">
Tag {{ i }}
</p-tag>
</p-tag-wrapper>

<div>
<p>Inline</p>
<div class="border border-default p-2 max-w-full">
<p-tag-wrapper :tags="numberArr" justify="left" inline class="border border-default" />
</div>
</div>
</div>
</template>
</ComponentPage>
Expand Down
2 changes: 1 addition & 1 deletion demo/sections/components/TagsInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<template #tags-input>
<div class="tags-input__demo">
<p-tags-input v-model="exampleTagsValue" :disabled="disabled" :state="exampleState" />
<p-tags-input v-model="exampleTagsValue" empty-message="All tags" :disabled="disabled" :state="exampleState" />

<p-code inline>
value: {{ JSON.stringify(exampleTagsValue) }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Select/PSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</template>

<template v-else-if="multiple">
<PTagWrapper :tags="tags">
<PTagWrapper :tags="tags" inline>
<template #tag="{ tag }">
<slot name="tag" :label="tag.label" :value="tag.value" :dismiss="() => dismissTag(tag)">
<PTag :dismissible="isDismissible(tag)" @dismiss="dismissTag(tag)">
Expand Down
Loading

0 comments on commit b98be7e

Please sign in to comment.