Open
Description
Especially when connections are slow, but even on localhost, the model is not fast enough to send the data to the backend, when the model saving method is called shortly after the last keypress. See this example:
class PersonView(UnicornView):
person = Person.objects.none()
def mount(self):
self.person = Person.objects.get(
pk=self.component_kwargs["pk"]
)
def save(self):
self.person.save()
<div>
<input type="text" unicorn:model="person.name" unicorn.keyup.enter="save">
</div>
When you run that component, write a longer string like "sdhfkjhdsfkjhkjdsf" and quickly press Enter, the saved model's name field will only contain approximately "sdhfkjhds".
I want to use unicorn for "inline" editing - a <input>
replaces the text when in edit_mode
and is saved automatically if in any of the input fields the user presses Enter. A quick and responsive UI is important, and data loss is very bad, in any case.
Metadata
Metadata
Assignees
Labels
No labels