bernhardh / nova-translation-editor

A laravel nova translation editor
12 stars 14 forks source link

Fix rows disappearing on any keypress, if the filter string no longer applies #13

Closed andzandz closed 2 years ago

andzandz commented 2 years ago

Hello! Nice translation editor package you have here.

Soon after installation, I found an irritating bug with the filter, outlined below.

If you want to edit part of the text that doesn't appear in the filter string, all works OK:

Screenshot

If you want to edit the filter string within the text, the row will immediately disappear after one keypress before you are finished editing, as the filter is re-evaluated immediately and is no longer found:

Screenshot

This PR fixes this behaviour, by copying translations into originalTranslations and filtering on those instead:

Screenshot

We are using Nova 3 at the moment, so I have made this PR from version 1.3.3. If you could, a new 1.x version would be helpful, e.g. if you create a version 1 branch.

bernhardh commented 2 years ago

Thanks for creating this pull request. Since I don't use nova anymore, since I migrated to filamentadmin, I can't test it. Try out v1.4.1. I have created a v1 branch from 1.3.3 as well. Master ist for Nova 4

bernhardh commented 2 years ago

Plus it would be cool, if you could do your changes for v2 as well.

andzandz commented 2 years ago

@bernhardh Thanks for the new release. Applying the same changes to v2 should be fairly easy, but we don't have a Nova 4 license to test it with. The easiest way would probably be for you to create a new local Laravel project with Nova 4 to test it

bernhardh commented 2 years ago

Well, I am not using nova anymore, so I close this pull request.