Skip to content

Commit

Permalink
dont set id attribute if not using tinymce for textarea controls, cau…
Browse files Browse the repository at this point in the history
…ses duplicate id attributes (on say new lead page) [krayin#2025]
  • Loading branch information
cdwiegand authored Feb 21, 2025
1 parent 9790fbf commit 34bcff4
Showing 1 changed file with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,29 @@ class="flex w-full items-center overflow-hidden rounded-md border text-sm text-g
{{ $attributes->only(['name', ':name', 'value', ':value', 'v-model', 'rules', ':rules', 'label', ':label']) }}
name="{{ $name }}"
>
<textarea
type="{{ $type }}"
name="{{ $name }}"
v-bind="field"
id="{{ $attributes->get(':id', $attributes->get('id')) }}"
:class="[errors.length ? 'border !border-red-600 hover:border-red-600' : '']"
{{ $attributes->except(['value', ':value', 'v-model', 'rules', ':rules', 'label', ':label'])->merge(['class' => 'w-full rounded border border-gray-200 px-2.5 py-2 text-sm font-normal text-gray-800 transition-all hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300 dark:hover:border-gray-400 dark:focus:border-gray-400']) }}
>
</textarea>

@if ($attributes->get('tinymce', false) || $attributes->get(':tinymce', false))
@if ($attributes->get('tinymce', false) || $attributes->get(':tinymce', false))
<textarea
type="{{ $type }}"
name="{{ $name }}"
v-bind="field"
id="{{ $attributes->get(':id', $attributes->get('id')) }}"
:class="[errors.length ? 'border !border-red-600 hover:border-red-600' : '']"
{{ $attributes->except(['value', ':value', 'id', 'v-model', 'rules', ':rules', 'label', ':label'])->merge(['class' => 'w-full rounded border border-gray-200 px-2.5 py-2 text-sm font-normal text-gray-800 transition-all hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300 dark:hover:border-gray-400 dark:focus:border-gray-400']) }}
>
</textarea>
<x-admin::tinymce
:selector="'textarea#' . $attributes->get(':id', 'id')"
::field="field"
/>
@else
<textarea
type="{{ $type }}"
name="{{ $name }}"
v-bind="field"
:class="[errors.length ? 'border !border-red-600 hover:border-red-600' : '']"
{{ $attributes->except(['value', ':value', 'v-model', 'rules', ':rules', 'label', ':label'])->merge(['class' => 'w-full rounded border border-gray-200 px-2.5 py-2 text-sm font-normal text-gray-800 transition-all hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300 dark:hover:border-gray-400 dark:focus:border-gray-400']) }}
>
</textarea>
@endif
</v-field>

Expand Down

0 comments on commit 34bcff4

Please sign in to comment.