mirror of
https://github.com/tiennm99/coolify.git
synced 2026-06-27 11:06:14 +00:00
feat(forms): make textarea monospace opt-in and improve multiline toggle
Add `monospace` prop to Textarea component so font-mono is no longer applied by default. Apply it explicitly to env variable editors, private key fields, and shared variable forms where monospace is appropriate. Use Alpine.js x-data/x-model to make the multiline toggle reactive without a full Livewire round-trip. Add wire:key on the input/textarea wrappers to force proper DOM replacement when switching modes.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
it('uses Alpine entangle to switch add value field immediately when multiline is enabled', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/project/shared/environment-variable/add.blade.php'));
|
||||
|
||||
expect($view)
|
||||
->toContain('x-data="{ isMultiline: $wire.entangle(\'is_multiline\') }"')
|
||||
->toContain('<template x-if="isMultiline">')
|
||||
->toContain('<template x-if="!isMultiline">')
|
||||
->toContain('x-model="isMultiline"')
|
||||
->toContain('<x-forms.textarea id="value" label="Value" required class="font-sans" spellcheck />')
|
||||
->toContain('wire:key="env-value-textarea"')
|
||||
->toContain('wire:key="env-value-input"');
|
||||
});
|
||||
|
||||
it('uses distinct keyed branches for the edit value field modes', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/project/shared/environment-variable/show.blade.php'));
|
||||
|
||||
expect($view)
|
||||
->toContain('wire:key="env-show-value-textarea-{{ $env->id }}"')
|
||||
->toContain('wire:key="env-show-value-input-{{ $env->id }}"');
|
||||
});
|
||||
Reference in New Issue
Block a user