Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when deleting form entry while editing it #6924

Closed
DeRaNGeR opened this issue Aug 30, 2022 · 0 comments
Closed

Error when deleting form entry while editing it #6924

DeRaNGeR opened this issue Aug 30, 2022 · 0 comments
Assignees
Labels
bug Something is not working as expected editor Issues related to the Defold editor javafx Issue related to JavaFX in the editor

Comments

@DeRaNGeR
Copy link

DeRaNGeR commented Aug 30, 2022

Describe the bug (REQUIRED)
When editing a form such as input bindings and adding a new entry but not filling out all data and immediately deleting the entry will cause a crash

To Reproduce (REQUIRED)
Steps to reproduce the behavior:

  1. open game.input_binding file
  2. add one action
    image
  3. when you want to insert the "name" for that action, leave it empty and without blur the textfield click on the minus icon
  4. Observe error
    image

Expected behavior (REQUIRED)
No crash

Defold version (REQUIRED):

  • Version 1.3.4

Platforms (REQUIRED):

  • Platforms: any
  • OS: Windows 11
  • Device: Laptop
@DeRaNGeR DeRaNGeR added the bug Something is not working as expected label Aug 30, 2022
@britzl britzl added the editor Issues related to the Defold editor label Aug 31, 2022
@britzl britzl added this to To do in 1.3.7 via automation Sep 1, 2022
@britzl britzl removed this from To do in 1.3.7 Oct 5, 2022
@britzl britzl changed the title Cannot paste inside .vp file from built-in editor Error when deleting form entry while editing it Jan 5, 2023
@defold defold deleted a comment from matgis Jan 5, 2023
@defold defold deleted a comment from DeRaNGeR Jan 5, 2023
@vlaaad vlaaad self-assigned this Apr 4, 2023
@vlaaad vlaaad added the javafx Issue related to JavaFX in the editor label Apr 4, 2023
vlaaad added a commit that referenced this issue Apr 5, 2023
User-facing changes: deleting a row with a currently-edited table cell no longers throws an exception.

Technical notes: JavaFX strikes again... This looks like a helpful behavior they introduced in some update — committing a change of a cell that loses focus. Unfortunately, it happens to be executed in the order we didn't anticipate. The user clicks the "Remove" button -> we execute the `:remove-table-selection` handler -> we now get new items -> we set new items on a table view -> table view notices that we edit the table and commits the edit before replacing the cell -> we execute the `:commit-table-edit` handler on a new items vector, but the edit is applied as if to the old items vector. I.e. we track an index to change while editing, and it corresponds to the old vector. So, if we remove the last item that was edited, the index will be out of bounds by one. Applying the edit is `(assoc items index new-value)`, which will act as `conj` in case of off-by-one `assoc`. Just canceling the edit will prevent JavaFX from committing it which is a way out of this mess.

Fixes #6924
@matgis matgis closed this as completed in 904d047 Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected editor Issues related to the Defold editor javafx Issue related to JavaFX in the editor
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants