Skip to content

Commit

Permalink
chore: move character count on textarea (#7012)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaiss authored Nov 7, 2023
1 parent 97f11b1 commit 9d0b8ec
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions resources/js/Shared/Form/TextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,17 @@ defineExpose({

<template>
<div class="mb-3">
<label v-if="label" class="mb-2 block text-sm dark:text-gray-100" :for="id">
<label v-if="label" class="mb-2 block relative text-sm dark:text-gray-100" :for="id">
{{ label }}
<span v-if="!required" class="optional-badge rounded px-[3px] py-px text-xs">
{{ $t('optional') }}
</span>

<span
v-if="maxlength && displayMaxLength"
class="length absolute end-0 top-0 rounded px-1 py-[3px] text-xs dark:text-gray-100">
{{ charactersLeft }}
</span>
</label>

<div class="relative">
Expand All @@ -125,11 +131,6 @@ defineExpose({
@keydown.esc="sendEscKey"
@focus="showMaxLength"
@blur="displayMaxLength = false" />
<span
v-if="maxlength && displayMaxLength"
class="length absolute end-2.5 top-2.5 rounded px-1 py-[3px] text-xs dark:text-gray-100">
{{ charactersLeft }}
</span>
</div>
<p v-if="markdown" class="rounded-b-lg bg-slate-100 px-3 py-2 text-xs dark:bg-slate-900">
<span>{{ $t('We support Markdown to format the text (bold, lists, headings, etc…).') }}</span>
Expand Down

0 comments on commit 9d0b8ec

Please sign in to comment.