Skip to content

Commit 2ba221e

Browse files
committed
bug: Inline editing is resetting the value
After updating the value, if we click away of the input, the value was being reset to the original one, this was happenning witn alpine 3x. To fix it, I set the original value to the newest value after editing it
1 parent 30d85ae commit 2ba221e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/views/components/editable.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
x-model="value"
1818
@keydown.enter="$wire.update(id, {
1919
[field]: value
20-
}); editing = false;"
20+
}); editing = false; original = value"
2121
@keydown.escape="editing = false; value = original;"
2222
class="block appearance-none w-full bg-white border-gray-300 hover:border-gray-500 px-2 py-1 rounded focus:outline-none focus:bg-white focus:border-blue-600 focus:border-2 border">
2323
<div x-show="!editing"

0 commit comments

Comments
 (0)