Fix: Domains input dirty state reset on blur #6897
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The
wire:model.bluron the Domains input in the Application General settings was causing the entire form's dirty state to reset when blurring out of the input. This led to a jarring UI flicker as dirty indicators disappeared and reappeared unexpectedly.Root Cause
The
wire:model.blurdirective syncs the input value to the server upon losing focus. This triggers a full component round-trip, during which Livewire re-evaluates all component properties and their canonical server states. This re-evaluation incorrectly resets thewire:dirtytrackers for all inputs, including those that were legitimately modified.Solution
Removed the
.blurmodifier from thewire:modeldirective for the Domains input field. This changes the binding behavior to deferred synchronization (wire:modelinstead ofwire:model.blur), meaning the input value will only sync to the server upon form submission.Changes
resources/views/livewire/project/application/general.blade.phpto changewire:model.blur="application.fqdn"towire:model="application.fqdn"on lines 93 and 98.This change ensures that the Domains input no longer triggers a premature server sync on blur, thus preventing the incorrect reset of the form's dirty state and providing a smoother user experience.