Skip to content

CellEditor: complete cell edit if another popup opens#1657

Closed
cguglielmo wants to merge 4 commits intoreleases/25.2from
features/cgu/25.2/cell_editor_417214
Closed

CellEditor: complete cell edit if another popup opens#1657
cguglielmo wants to merge 4 commits intoreleases/25.2from
features/cgu/25.2/cell_editor_417214

Conversation

@cguglielmo
Copy link
Member

Popup._onPopupOpen calls close() but that should not be called for cell editors because it just closes the editor without correctly cancelling or completing the edit.
Instead of extracting the close() call of _onPopupOpen in a method with a name to be defined, close() now just delegates to completeCellEdit().

417214

@cguglielmo cguglielmo force-pushed the features/cgu/25.2/cell_editor_417214 branch 3 times, most recently from ad69e61 to 1b4c05b Compare August 15, 2025 13:13
Currently, if a column has a max length and htmlEnabled set to true,
the html content may be truncated incorrectly resulting in UI errors.
This happens because the Scout JS table just concatenates the table rows
together and if the cells contain html tags especially <div> that are
not closed, the rows won't be built correctly.

Now, only the text inside the html content will be truncated preserving
the html tags.

Also: add ellipsis if text is truncated in a string column.

426350
Popup._onPopupOpen calls close() but that should not be called for
cell editors because it just closes the editor without correctly
cancelling or completing the edit.
Instead of extracting the close() call of _onPopupOpen in a method with
a name to be defined, close() now just delegates to completeCellEdit().

Also, if cell editing has been started and startCellEdit() is called
again, the existing edit needs to be ended first, otherwise an error may
occur because the new cell editor popup closes the existing editor first
which calls field.acceptInput(), but popup.cell.field is already the new
field which is not rendered yet.

417214
@cguglielmo cguglielmo force-pushed the features/cgu/25.2/cell_editor_417214 branch from 1b4c05b to 9749893 Compare September 9, 2025 09:10
The cell editor waits for the field's acceptInput promise to be
resolved when completing the cell edit before the value can be written
to the cell and the editor closed.
Unfortunately, if acceptInput of the SmartField is called a second time,
a new deferred instance will be created without resolving the previous
one. This has the effect that the cell editor never closes.

This can happen if a cell editor is open, the user types invalid text
and another popup opens at the same time ->
1. the cell editor closes, calls completeCellEdit and waits for
   acceptInput
2. the new popup takes the focus which blurs the smart field and calls
   acceptInput again -> a new deferred is created.

417214
@cguglielmo cguglielmo force-pushed the features/cgu/25.2/cell_editor_417214 branch from 9749893 to 74f8014 Compare September 9, 2025 14:40
@cguglielmo
Copy link
Member Author

Merged with a separate PR for 26.1 only.

@cguglielmo cguglielmo closed this Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant