Skip to content

Commit

Permalink
Refactor character count display in edit.blade.php
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPunyapal committed Apr 6, 2024
1 parent 53b501e commit 0c09720
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions resources/views/livewire/questions/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,21 @@
<div class="w-full">
<div
class="mb-1"
x-data="{
content: '',
get characterCount() {
return this.content.length
},
}"
>
<label for="{{ 'answer_question_'.$question->id }}" class="sr-only">Answer</label>

<textarea
id="{{ 'answer_question_'.$question->id }}"
wire:model="answer"
x-ref="content"
x-model="content"
x-autosize
class="h-24 w-full border-none border-transparent bg-transparent text-white resize-none focus:border-transparent focus:outline-0 focus:ring-0"
placeholder="Write your answer..."
maxlength="1000"
rows="3"
></textarea>

<p x-ref="characterCount" class="text-right text-xs text-slate-400">
<span x-text="characterCount"></span>
<p class="text-right text-xs text-slate-400">
<span x-text="$wire.answer.length"></span>
/ 1000
</p>

Expand Down

0 comments on commit 0c09720

Please sign in to comment.