Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main --> development #349

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions resources/views/components/textarea.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
@endphp
<div class="relative w-full @if($add_clearing) mb-3 @endif">
@if($toolbar)
<div id="{{$name}}">{{$selected_value}}</div>
<div id="{{$name}}"></div>
<textarea hidden name="{{ $name }}" id="{{ $name }}-hidden" class="size-0"></textarea>
@else
<textarea {{ $attributes->merge(['class' => "bw-input peer $is_required $name $placeholder_color"]) }}
Expand Down Expand Up @@ -117,12 +117,14 @@
} else {
quillOptions.modules.toolbar = modifyToolbarOptions(toolbarOptions, '{{$except}}');
var quill_{{$name}} = new Quill('#{{$name}}', quillOptions);

// Update the hidden input field whenever the textarea content changes
quill_{{ $name }}.on('text-change', function(delta, oldDelta, source) {
var value = quill_{{ $name }}.root.innerHTML;
document.getElementById('{{ $name }}-hidden').value = value;
});

// set the initial content for quill
quill_{{ $name }}.root.innerHTML = @js($selected_value);
}
</script>
@endif